Skip to main content
POST
This is the OpenAI-compatible Chat Completions endpoint, for both stream and non-stream calls. A non-stream 200 is a chat.completion with usage and mifr_receipt. Stream is SSE (text/event-stream): a role chunk, content deltas, keepalives every 10 seconds (: keepalive), a stop chunk, then data: [DONE]. The JSON model field echoes the request. The alias actually served is x-mifr-model / mifr_receipt.model_id.
string
required
Bearer product key. Format: Bearer sk-mifr_…. See Authentication.
string
required
Catalog alias or Hugging Face id. An empty value is 400. An unknown name is 404 model_not_found. Default alias: qwen3-4b.
object[]
required
Non-empty. Each item needs role. Max 100 messages, 256 KiB total content chars.
number
default:"512"
Integer. Fractional values are rejected. Qwen3 is a thinking model, so a tiny cap often fills with <think>… and never reaches a visible answer.
number
Alias for max_tokens. max_tokens wins if both are set.
number
default:"0.7"
Number. Bools and string numbers are rejected.
boolean
default:"false"
If true, respond as SSE. The receipt and x_mifr_* verdicts are on the final chunk, not on the SSE HTTP head.
string
Pin one Mac: exact provider id, or a unique prefix of at least 8 characters. A pin does not hop or hedge. If that Mac is offline or below the floor, the call returns 503 provider_unavailable.
string
Alias for provider.
object
Extra keys are ignored. include_usage still appears on the stop chunk.

Response

string
Completion id.
string
chat.completion (non-stream) or chat.completion.chunk (stream).
string
Echo of the request model field.
object[]
Standard OpenAI choices. A stream sends a role chunk, then content deltas, then a stop chunk.
object
Token counts from the verified receipt. Present on non-stream 200 and on the terminal SSE chunk.
object
Signed, request-bound receipt. This is the proof; HTTP x-mifr-* headers are the gateway’s report of the same facts.
Failure after the first streamed token puts the same error object in data: and omits [DONE]. Do not splice a retry onto those bytes. If the caller hangs up, the gateway aborts the seal (aborted) and sends no body. See Errors and headers for the full mifr_action table and verdict header list.