Create a chat completion
OpenAI Chat Completions format, streaming included.
OpenAI Chat Completions format. Send stream: true for Server-Sent Events, ending with data: [DONE]. The x-bitrouter-request-id response header identifies the request for settlement.
x-api-key: <key>. Anthropic SDKs send this.
In: header
Request Body
application/json
Chat completion request.
TypeScript Definitions
Use the request body type in TypeScript.
Chat Completions request body (https://platform.openai.com/docs/api-reference/chat/create).
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/chat/completions" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "role": "string" } ], "model": "string" }'{ "choices": [ { "finish_reason": "string", "index": 0, "message": { "content": "string", "role": "string" } } ], "created": 0, "id": "string", "model": "string", "object": "string", "usage": { "completion_tokens": 0, "prompt_tokens": 0, "total_tokens": 0 }}How is this guide?