Bắt đầu/API tham khảo

API tham khảo

Base URL

text
https://dirtcheapai.com/api/v1

Xác thực

http
Authorization: Bearer key_xxx

Danh sách endpoint

MethodEndpointGhi 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

StatusMeaning
`400`Invalid request
`401`Missing or invalid API key
`402`Insufficient credits or inactive package
`429`Rate limit reached
`500`Internal error