Endpoints
POST
/v1/chat/completions
Chat completions
GET
/v1/models
List available models
POST
/v1/embeddings
Create embeddings
Chat Completions
Create a chat completion. Fully OpenAI-compatible request/response format.
POST
/v1/chat/completions
Request body parameters follow the OpenAI Chat Completions spec. Key additions:
model: deepseek-v4-flash
model: qwen-3-max
model: glm-5
stream: true|false
max_tokens: 4096
Streaming
Set stream: true in the request body to receive SSE (Server-Sent Events). Each event contains a delta with token content.
Terminate with data: [DONE] event. Connection is HTTP/1.1 keep-alive compatible.
Models
GET
/v1/models
List all available models
Returns an array of model objects with id, object, created, and owned_by fields. OpenAI-compatible format.
Embeddings
POST
/v1/embeddings
Create embedding vectors
Input text and receive a vector embedding. Supports batch inputs for multiple texts in one request.
Error Codes
400
Invalid request — malformed JSON or missing required field
401
Unauthorized — invalid or missing API key
402
Insufficient balance — top up in Console
404
Model not found — check model name
429
Rate limited — slow down and retry
500
Server error — retry with backoff