Create a chat completion

OpenAI Chat Completions-compatible skin over the same Infer routing, wallet, privacy, cache, media, tool, and receipt engine used by /v1/responses. With stream=true, chat.completion.chunk events carry upstream reasoning, text, and tool-call argument deltas as they arrive; the final finish chunk includes relay receipt metadata and stream_options.include_usage adds the settled usage chunk. Infer emits keepalive comments during quiet periods and does not impose a generation wall-clock timeout while the connection remains alive.

post/v1/chat/completions

Request

  • Base URL: https://infer.flow7.org
  • URL: https://infer.flow7.org/v1/chat/completions
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Optional Infer idempotency key. A one-use key is generated when omitted.

X-Session-Affinitystring

Optional Infer session-affinity/cache-routing extension.

Request body

modelstring required
max_completion_tokensinteger

Requested output ceiling. Capacity is limited by the selected Infer model/price option and its eligible routes, not by a global Infer token cap.

max_tokensinteger

Requested output ceiling. Capacity is limited by the selected Infer model/price option and its eligible routes, not by a global Infer token cap.

streamboolean
stream_optionsobject
temperaturenumber
top_pnumber
presence_penaltynumber
frequency_penaltynumber
seedinteger
stopunknown
toolsobject[]
tool_choiceunknown
parallel_tool_callsboolean
response_formatobject
storeboolean
prompt_cache_keystring
cache_controlobject

Response

Chat completion or SSE stream

idstring required
object'chat.completion' required
createdinteger required
modelstring required
choicesobject[] required
usageobject required

Changes

No recorded changes to this operation across all 1 revision of this API.