Skip to main content
POST
Create a chat completion

Authorizations

Authorization
string
header
required

An API key from the Morse app. It starts with sk_morse_.

Body

application/json

Only the fields below reach the model. Morse drops every other field without an error, such as temperature, top_p, n, stop, seed, response_format, logprobs, or user.

model
string
required

A chat model's id from GET /v1/models.

Minimum string length: 1
messages
object[]
required
Maximum array length: 4096
stream
boolean
default:false

Send the reply as server-sent events.

stream_options
object
max_completion_tokens
integer | null

The most output tokens the model may produce. Morse lowers a value above the model's max_output_tokens to max_output_tokens. When neither limit is set, the model's default applies. The account must hold credit for the most the request could cost, so a lower limit holds less credit.

Required range: x >= 1
max_tokens
integer | null

The same as max_completion_tokens. When both are set, max_completion_tokens wins.

Required range: x >= 1
reasoning_effort
string

How much a reasoning model reasons, such as low, medium, or high. Anthropic, Gemini, and OpenAI models use the nearest effort they support. When reasoning_effort is absent, the model's default applies.

tools
object[]
tool_choice

auto, none, required, or one named function.

Available options:
auto,
none,
required
parallel_tool_calls
boolean

Response

The reply. When stream is true, the body is server-sent events. Each data line is a ChatCompletionChunk, and the stream ends with data: [DONE]. If the provider fails after the first event, the stream ends with one error event in the Error shape and no [DONE]. Some reasoning models send a : keepalive comment every 25 seconds while they reason.

The reply. id is a new chatcmpl- id, and model is the id you sent. The exception is tee models, whose reply comes unchanged from the attested server.

id
string
required
object
any
required
model
string
required
choices
object[]
required
created
integer

Unix seconds.

usage
object