1. Base URL
https://cheaptoken.pro/v1/
All API requests should use this base URL. Compatible with the OpenAI SDK — just change the base URL.
2. Authentication
Include your API key in the Authorization header:
Authorization: Bearer sk-your-api-key-here
Get your API key from the API Keys page in your dashboard.
3. Chat Completion
curl https://cheaptoken.pro/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-key" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'
4. Available Models
curl https://cheaptoken.pro/v1/models \ -H "Authorization: Bearer sk-your-key"
View the full list on the Models page.
5. SDK Examples
Python (OpenAI SDK):
from openai import OpenAI
client = OpenAI(
base_url="https://cheaptoken.pro/v1",
api_key="sk-your-key"
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)
JavaScript:
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://cheaptoken.pro/v1',
apiKey: 'sk-your-key'
});
6. Error Codes
| Code | Description |
|---|---|
| 400 | Bad request — check your parameters |
| 401 | Invalid or missing API key |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
| 503 | Model temporarily unavailable |