Chat

OpenAI Protocol (GPT)

OpenAI Chat Completions / Responses compatible. For GPT, plus DeepSeek, GLM, etc.

Chat (REST + SSE)
POST/ v1/ chat/ completions
Codex (Responses)
POST/ v1/ responses
Model list
GET/ v1/ models

Authorization

AuthorizationstringheaderRequired
API key, sent as a Bearer token in the Authorization header.
Example:Bearer <API_KEY>

Supported Models

gpt-* (e.g. gpt-4o), deepseek-*, glm-* (e.g. glm-5.2), etc. See GET /v1/models.

Request body

application/json
modelstringRequired
Model, e.g. gpt-4o
messagesarrayRequired
Messages (role/content)
streamboolean
true for SSE; add stream_options.include_usage=true to get usage
temperature / top_pnumber
Sampling controls
max_tokens / max_completion_tokensinteger
Max output
tools / tool_choice—
Tool calling

Streaming (SSE)

Set "stream": true and "stream_options": {"include_usage": true}; receive SSE with curl -N. Events data: {chunk}, ends with data: [DONE]; usage in the final chunk.
Image Generation

Image Generation (GPT-Image · sync)NEW

Beyond chat, the same OpenAI protocol also offers synchronous image generation: a single request returns the image (url or b64_json) directly — no taskId, no polling. Developers already using an OpenAI SDK / images client can integrate as-is.

Text-to-image
POST/ v1/ images/ generations
Image edit (multipart)
POST/ v1/ images/ edits
Variations (multipart)
POST/ v1/ images/ variations

Supported Models

gpt-image-1 / gpt-image-1.5 / gpt-image-2 / gpt-image-2.5-flare / gpt-image-2.5-sunburst.

Request body

application/json
modelstringRequired
gpt-image-1 / gpt-image-1.5 / gpt-image-2 / gpt-image-2.5-flare / gpt-image-2.5-sunburst
promptstringRequired
Image description
sizestring
Output size (official pixels, default 1024x1024)
response_formatstring
url (a stable, long-lived link on our CDN — it does not expire shortly after generation) or b64_json (inline image data; gpt-image-1 often returns this)
⚠ This synchronous channel and the async GPT-Image channel (POST /api/cqt/generator/gpt-image) are billed differently — the same model may cost a different amount on each, so check the pricing page. Image-to-image / variations use multipart /v1/images/edits and /v1/images/variations.

💰 See the pricing page for prices →