curl
Call every endpoint from the command line.
Set your key once:
export CHEAPAIMODEL_API_KEY="sk-..."List models
curl https://api.cheapaimodel.ai/v1/models \
-H "Authorization: Bearer $CHEAPAIMODEL_API_KEY"Chat completion
curl https://api.cheapaimodel.ai/v1/chat/completions \
-H "Authorization: Bearer $CHEAPAIMODEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "deepseek-v4-1-flash", "messages": [{"role": "user", "content": "Hello!"}]}'Add "stream": true and pass -N to curl to see tokens as they arrive.
Response
curl https://api.cheapaimodel.ai/v1/responses \
-H "Authorization: Bearer $CHEAPAIMODEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "deepseek-v4-1-flash", "input": "Hello!"}'Message (Anthropic format)
No model in the catalog currently lists /v1/messages. The request below shows the shape; replace <model-id> with a model whose catalog page lists this endpoint.
curl https://api.cheapaimodel.ai/v1/messages \
-H "x-api-key: $CHEAPAIMODEL_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model": "<model-id>", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello!"}]}'Embeddings
No model in the catalog currently lists /v1/embeddings. The request below shows the shape; replace <model-id> with a model whose catalog page lists this endpoint.
curl https://api.cheapaimodel.ai/v1/embeddings \
-H "Authorization: Bearer $CHEAPAIMODEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "<model-id>", "input": "The quick brown fox"}'