API Documentation
Get started with CheapAPI in 3 minutes.
Quick Start
1. Get your API key
After subscribing, your API key is sent to your email. It looks like: sk-th-xxxxxxxxxxxx
2. Install OpenAI SDK
pip install openai3. Make your first request
from openai import OpenAI
client = OpenAI(
base_url="https://api.cheap-api.io/v1",
api_key="sk-th-your-key-here",
)
response = client.chat.completions.create({
"model": "deepseek-chat",
"messages": [{
"role": "user",
"content": "Hello, world!",
}],
})
print(response.choices[0].message.content)Available Models
| Model ID | Provider | Best For |
|---|---|---|
| deepseek-chat | DeepSeek-V3 | General purpose, coding |
| deepseek-reasoner | DeepSeek-R1 | Math, logic, reasoning |
| qwen-max | Alibaba Qwen-Max | Multilingual, enterprise |
| qwen-plus | Alibaba Qwen-Plus | Balanced perf/cost |
| glm-4 | Zhipu GLM-4 | Cheapest, good quality |
| glm-4-flash | Zhipu GLM-4 Flash | Lightweight tasks |
API Endpoints
POST
/v1/chat/completionsChat completions (OpenAI-compatible)GET
/v1/modelsList available modelsGET
/healthHealth checkRate Limits & Errors
| HTTP Code | Meaning |
|---|---|
| 200 | Success |
| 401 | Invalid or missing API key |
| 429 | Monthly quota exceeded or rate limit hit — upgrade your plan |
| 503 | Upstream model temporarily unavailable, retry in 5s |