POST /v1/chat/completions:stream
ChatCompletionStream relays provider chunks as Server-Sent Events. Nexus reserves before the first chunk and settles once Bifrost reports final usage.
The server validates credentials, tenant, environment and permissions. This page does not send requests. Replace example values; deployed server validation remains authoritative.
Parameters
No path or query parameters.
Request body
customer_account_idstringmax_tokensinteger · int32messages_jsonstringmodelstringoffer_idstringoperation_keystringproviderstring
cURL
curl --request POST 'https://nexus-api.rainlib.com/v1/chat/completions:stream' \
--header 'Authorization: Bearer <NEXUS_ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"customer_account_id": "<value>",
"max_tokens": 0,
"messages_json": "<value>",
"model": "<value>",
"offer_id": "<value>",
"operation_key": "<value>",
"provider": "<value>"
}'Response contract
200 · OK
attempt_idstringdata_jsonstringA provider-native OpenAI-compatible chunk, serialized as JSON.
donebooleanoperation_idstringusageobjectExpand fields
completion_tokensstringprompt_tokensstringtotal_tokensstring
Generated responses do not enumerate every runtime error. See the integration guide for authentication, conflicts and retries.