cheapaimodel

Overview

Base URL, authentication, errors and every endpoint of the cheapaimodel API.

Copy

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.ai

OpenAI-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

MethodPath
GET/v1/modelsList models
POST/v1/chat/completionsCreate a chat completion
POST/v1/responsesCreate a response
POST/v1/messagesCreate a message
POST/v1/embeddingsCreate 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.