OpenAI-compatible API documentation

ChatGPT, Codex and GLM through one API.

Model.sale exposes a familiar OpenAI-compatible base URL for ChatGPT-compatible GPT, Codex clients, GLM and DeepSeek models. Keep your key server-side, use a live model ID and inspect the request ID and usage returned with every call.

ChatGPT-compatible GPTUse Responses or Chat Completions from an OpenAI SDK. The model ID stays unchanged end to end.
CodexConnect Codex CLI, App or VS Code with the Responses protocol and select a model whose catalog row includes /v1/responses.
GLM and DeepSeekCall the live open-model IDs with Chat Completions and optional SSE streaming.
1. AuthenticateSend Authorization: Bearer ms_live_…. Keys are shown once and can be revoked from the dashboard.
2. Add balanceDeposit at least $5. Funds are reserved before dispatch and settled from terminal usage.
3. Call a modelUse a model from GET /v1/models. A request is never silently routed to another model.

Endpoints

MethodPathPurpose
GET/v1/modelsPublished live catalog
POST/v1/responsesResponses JSON and SSE (GPT/Codex)
POST/v1/chat/completionsChat Completions JSON and SSE (GPT/GLM/DeepSeek)
POST/v1/messagesOnly when Anthropic Messages validation is published
Protocol capability is model-specific. Use /v1/catalog to see each model's current supported_endpoints. Codex requires a live model with /v1/responses; GLM and DeepSeek currently use /v1/chat/completions. A model is never silently substituted when the requested protocol is unavailable.

Minimal Responses request

curl https://api.model.sale/v1/responses \\n  -H \"Authorization: Bearer $MODEL_SALE_API_KEY\" \\n  -H \"Content-Type: application/json\" \\n  -d '{\"model\":\"gpt-5.6-luna\",\"input\":\"Reply exactly OK\"}'

Streaming

Set stream: true. Responses streams finish with a terminal response event; Chat Completions streams finish with [DONE]. The gateway adds x-model-sale-request-id to every response. Usage is required for exact settlement; incomplete usage is marked for reconciliation.

Errors and limits

401 indicates authentication failure, 402 indicates insufficient balance, 409 indicates an idempotency conflict, 429 indicates a rate/spend/concurrency limit, and 5xx indicates an unsuccessful model or internal operation.