API tham khảo
Base URL
text
https://dirtcheapai.com/api/v1Xác thực
http
Authorization: Bearer key_xxxDanh sách endpoint
| Method | Endpoint | Ghi chú |
|---|---|---|
| POST | `/chat/completions` | Request chat theo chuẩn OpenAI |
| POST | `/messages` | Request message theo chuẩn Anthropic |
| POST | `/messages/count_tokens` | Đếm token cho payload Anthropic |
| POST | `/responses` | Responses API theo chuẩn OpenAI |
| GET | `/models` | Danh sách model hiện tại |
| GET | `/balance` | Số dư và trạng thái gói |
Mã lỗi thường gặp
| Status | Meaning |
|---|---|
| `400` | Invalid request |
| `401` | Missing or invalid API key |
| `402` | Insufficient credits or inactive package |
| `429` | Rate limit reached |
| `500` | Internal error |