/models/chat and /models/two answer the same way; each reaches chat models only. Decision models answer at /models/decision and transcription models at /models/transcribe. The route is stateless: there is no conversation id, so send the full message list every time.
Headers
- AuthorizationstringRequired
- Bearer and your API key.
- Content-TypestringRequired
- application/json. Anything else is refused with 415.
- Acceptstring
- Must allow application/json for a whole answer, or text/event-stream for a stream; otherwise the call is refused with 406. It never changes which one you get.
Body
- systemPromptstringRequired
- The instructions binding the whole turn. Not a message: it sits outside the array, and every string is literal prompt text.
- messagesMessage[]Required
- The conversation so far, at least one message and at most 256. A union on type; the same shape comes back in a reply, so a turn you receive can be appended and sent again, to any provider.
- typestringRequired
- Who said it: what the caller said, what a model said, a model’s reasoning, a call the model made, or the answer to one call.
usercontentthinkingtoolCalltoolResult - valuestring
- For user, content and thinking: the text.
- filesFile[]
- For user: anything attached. See Files and file processing.
- typestringRequired
- An absolute http or https address, or base64 bytes. Handles are refused.
urlbytes - valuestringRequired
- The address, or the base64 bytes.
- namestringRequired
- The file’s name.
- contentTypestringRequired
- A valid media type, such as application/pdf.
- dataobject
- For content and thinking: the provider state that lets reasoning replay natively. Keep it when you store a turn.
- callobject
- For toolCall: id, name, arguments and data. arguments is a JSON string, not an object.
- resultobject
- For toolResult: id, name, content, documents and failure. id pairs it with an earlier call.
- modelstring | objectDefault
auto - Which models may answer. A string is a selector such as claude-sonnet-5, anthropic/claude-sonnet-5 or tier/high; auto and * mean every model. A tier, auto or * leaves out deprecated models and models released on or before the cut-off, unless prioritization lets them in. Send model or models, not both.
- namestringDefault
auto - The model’s canonical name.
- tierstring
- Any model in that tier. Left out, any tier. A model not yet classified is never served.
freelowmediumhighxhightierless - publisherstring
- The catalog’s ownedBy, or * for any publisher.
- providerstring
- The catalog’s provider: the service that runs the call. Never *.
- except(string | object)[]
- Selectors whose models this one leaves out.
- namestringDefault
- models(string | object)[]
- Several selectors, tried in the order given.
- prioritizationobjectDefault
{} - Which providers serve first and which never do.
- orderstring[]
- Providers that lead, in this order, ahead of price: a root such as azure, or a region as name@region, such as azure@eu.
- ignorestring[]
- Providers that serve nothing on this call. A root leaves out the root alone; name@region leaves out that region alone.
- sortstringDefault
price - After order, the cheapest offering first.
price - zdrbooleanDefault
false - Run the call under zero data retention: only on saved keys marked zdr and on Momor’s keys its own agreements cover, never on keys sent with the call. Where your organization holds every call to it, false here does not turn it off.
- deprecatedboolean
- Let deprecated models serve a tier, auto or * selector. Left out, your organization’s default, else false. A selector naming one exact model is served by it either way.
- maxAgestring
- How old a model may be, as ISO 8601 such as P6M, P1Y or P2Y, or a TimeSpan such as 180.00:00:00: a tier, auto or * selector is served only by models released no longer ago than this. A month counts thirty days and a year 365. Left out, your organization’s default, else no model is left out for its age. A selector naming one exact model is served by it whatever its age.
- keysobjectDefault
{} - Your own provider keys for this call, by provider name: a string, or an object holding key and the values the provider needs. Never recorded or logged.
- parametersobjectDefault
{} - Sampling and ceilings. Each goes to the provider under its own name; see How parameters reach providers below.
- maxTokensinteger
- Output ceiling. Anthropic requires one.
- temperaturenumber
- Provider default when left out.
- topPnumber
- Provider default when left out.
- reasoningEffortstringDefault
none - none, also what leaving it out sends, asks the model not to reason.
nonelowmediumhigh - toolUseobjectDefault
{ "type": "auto" } - Whether the model may call a tool, must call one, must call the named one, or must not.
autononeanyuse - strictboolean
- Hold the provider to responseSchema where it has a strict mode.
- stopstring[]
- Sequences at which the model stops.
- seedinteger
- The sampling seed.
- frequencyPenaltynumber
- Penalizes a token for each time it has appeared.
- presencePenaltynumber
- Penalizes a token that has appeared at all.
- parallelToolCallsbooleanDefault
true - false holds the model to one tool call a turn where the offering can.
- topKinteger
- How many of the likeliest tokens each step samples from.
- serviceTierstring
- The capacity the call is served from, sent as each provider’s own word.
autostandarddefaultflexpriorityscale - userstring
- A stable id for your own end user.
- metadataobject
- Labels, as strings, the provider stores against the call.
- logprobsboolean
- Return each answer token’s log probability.
- topLogprobsinteger
- How many alternatives come back beside each token.
- cachingstringDefault
auto - What the provider is asked to cache of the request’s prefix, several joined by commas.
autotoolssystemmessagescustomnone - networkTimeoutstring
- The longest one network operation of the call may take, as ISO 8601 such as PT30S or a TimeSpan such as 00:00:30, longer than zero and at most 100 seconds. It only ever shortens a call; on Anthropic it bounds the wait for the reply to begin. Never sent to the provider; left out, the provider’s client keeps its own.
- toolsTool[]Default
[] - Tools the model may call, at most 128, each named once. The declaration is translated into each provider’s format.
- namestringRequired
- The name the model calls.
- descriptionstringRequired
- What it does.
- parametersJSON SchemaRequired
- The argument shape.
- responseSchemaJSON Schema
- Holds the answer to a schema. Needs a model whose structuredOutput is jsonSchema.
- streamingbooleanDefault
false - Return server-sent events instead of one assembled turn. See Streaming.
- streamFailureBehaviorstringDefault
stop - What a failure does once output has begun: end the stream, or let the next candidate finish it. See Provider failover.
stoprollover - fileProcessingobjectDefault
{ "type": "none" } - Whether a file is converted before the model sees it. Never changes which model answers. Under zero data retention, anything but none is refused with 400.
- typestringRequired
- none sends files as they are; auto converts what the model can’t read; directed uses the processors in types.
noneautodirected - typesobject
- For directed: media type, or a prefix ending in *, to a processor or model name.
The body may be at most 30 MiB. Inline files may be at most 10 MiB each and 20 MiB together, and the serialized schemas, tools’ and responseSchema together, at most 256 KiB. These are the defaults; a deployment can lower them.
Response
- typestring
- monolith, for a whole answer.
- modelobject
- What actually served the call, after selector resolution and failover. Read it back rather than assuming it echoes your request.
- namestring
- The canonical name.
- tierstring
- The model’s tier.
- publisherstring
- Who made it.
- providerstring
- Who served it.
- messagesMessage[]
- The output in the order it was given: thinking, content and toolCall messages, the same union you send.
- usageobject
- As the provider reported it, not estimated.
- providerstring
- The provider the tokens were spent with.
- inputTokensinteger
- Input tokens.
- outputTokensinteger
- Output tokens.
- cacheReadTokensinteger
- Input read from the provider’s cache.
- cacheWriteTokensinteger
- Input written to the provider’s cache.
- thoughtTokensinteger
- Reasoning tokens, where the provider counts them apart.
- reasoningTokensinteger
- The part of outputTokens spent reasoning, where the provider counts it inside the output.
- finishReasonstring
- The provider’s own reason, as it gave it.
- fingerprintstring
- The provider’s id for the backend that served the turn, where it gives one.
Every answer the route gives, a routing refusal included, carries the call’s id in X-Momor-Request-Id. Who was tried and what each attempt cost are on the call record: read it with Get a generation. A stream’s frames are described in Streaming.
Errors
A failure before a stream opens is a problem document, { "status", "detail" }. Once a stream is open, a failure is an error frame inside it.
Every message detail can carry, and which failures are worth retrying, are on Errors.
How parameters reach providers
Nothing is refused because a provider would not take it. An optional parameter goes only to an offering whose catalog entry says it honours it; anywhere else it is left off and the provider applies its own default. Values are not checked: a provider that refuses one moves the call to the next candidate.
serviceTier takes Momor’s words, and each provider is sent its own. An OpenAI-compatible provider is sent the word as you wrote it; any other word is left off everywhere.
Prompt caching
Most of a call’s input repeats from one turn to the next. A provider that caches that prefix bills it at a fraction of its input price on the next call that starts the same way. Momor caches by default: caching is auto unless you set it. Values combine with commas, as in "tools, system", and custom sets aside every other value.
A breakpoint costs more than the input it covers when Anthropic writes it: a five-minute write is billed at 1.25 times the input price and an hour’s at twice it, and a read at a tenth or less. A prefix shorter than the model’s minimum, 512 to 4,096 tokens, is not cached and nothing is refused. Cached tokens come back in usage as cacheReadTokens, and Anthropic’s writes as cacheWriteTokens. A Chat Completions call has no caching: it reaches the provider with the caching fields you wrote.