Overview
Base URL, authentication, errors and every endpoint of the cheapaimodel API.
The cheapaimodel API speaks two wire formats on one host: OpenAI-compatible endpoints and the Anthropic Messages endpoint. Both use the same API keys and the same balance.
Base URL
https://api.cheapaimodel.aiOpenAI-style clients take https://api.cheapaimodel.ai/v1; Anthropic-style clients take the bare host. See Base URL for the value each SDK and tool expects.
Authentication
Send your API key as a bearer token. /v1/messages also accepts the Anthropic-style x-api-key header.
curl https://api.cheapaimodel.ai/v1/models \
-H "Authorization: Bearer $CHEAPAIMODEL_API_KEY"Create keys on the console's API Keys page. See Authentication & API keys for expiry, budgets and allowlists.
Endpoints
| Method | Path | |
|---|---|---|
GET | /v1/models | List models |
POST | /v1/chat/completions | Create a chat completion |
POST | /v1/responses | Create a response |
POST | /v1/messages | Create a message |
POST | /v1/embeddings | Create embeddings |
Set "stream": true on the generation endpoints to receive server-sent events; see Streaming.
Errors
Errors return a non-2xx status and a JSON body with error.message. Branch on the status code and error.code; see Errors for the full table.
OpenAPI
The machine-readable contract for these endpoints is at /docs/openapi.yaml. Feed it to an SDK generator or an AI assistant.