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.
/v1/responses.Authorization: Bearer ms_live_…. Keys are shown once and can be revoked from the dashboard.GET /v1/models. A request is never silently routed to another model.Endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/models | Published live catalog |
| POST | /v1/responses | Responses JSON and SSE (GPT/Codex) |
| POST | /v1/chat/completions | Chat Completions JSON and SSE (GPT/GLM/DeepSeek) |
| POST | /v1/messages | Only 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.