Create a chat completion
/v1/chat/completionsGenerate the next message in a conversation with the OpenAI Chat Completions format. Set stream to receive server-sent events.
Authorization
bearerAuth Your API key from the console: Authorization: Bearer sk-...
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
A model ID from List models.
false1 <= value1 <= value0 <= value <= 20 <= value <= 1Function tools the model may call.
{ "type": "json_object" } or a JSON schema, on models that support it.
Response Body
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 '{ "model": "deepseek-v4-1-flash", "messages": [ { "role": "user", "content": "Hello!" } ] }'{ "id": "string", "object": "chat.completion", "created": 0, "model": "string", "choices": [ { "index": 0, "message": { "role": "system", "content": "string", "name": "string", "tool_calls": [ {} ], "tool_call_id": "string" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0 }}List models GET
List the models your API key can call. Prices are in the public model catalog at https://cheapaimodel.ai/models (as Markdown: https://cheapaimodel.ai/pricing.md).
Create a response POST
Generate a model response with the OpenAI Responses API format. Set `stream` to receive server-sent events.