Referensi API
Complete documentation on endpoints, request/response format and error handling
Base URL & Authentication
https://api.arzastore.com/v1
Replace <endpoint> with the URL endpoint from your LLM API Keys page.
Authorization: Bearer sk-your-api-key
# Hoặc, cho SDK Anthropic:
x-api-key: sk-your-api-key
Use Authorization: Bearer for the OpenAI SDK, Gemini and most clients; x-api-key for the Anthropic SDK. Google's x-goog-api-key and ?key= are not accepted.
Content-Type: application/json
Endpoints
Text
Images
Audio
Video
Embeddings
Model listing
Error Handling
When an error occurs, the API returns JSON with an error field:
{
"error": {
"message": "Mô tả lỗi chi tiết",
"type": "invalid_request_error",
"code": "model_not_found"
}
}
HTTP Status Codes
| Code | Type | Description |
|---|---|---|
| 200 | OK | OK - Request successful |
| 400 | Bad Request | Bad Request - Invalid request |
| 401 | Unauthorized | Unauthorized - Invalid or missing API key |
| 402 | Payment Required | Insufficient balance |
| 403 | Forbidden | Forbidden - No permission to access this model |
| 404 | Not Found | Not Found - Model does not exist |
| 429 | Rate Limited | Too Many Requests - Rate limit exceeded |
| 500/502/503 | Server Error | Server-side error |
Retry Strategy
# curl tự retry với --retry (chỉ áp dụng cho lỗi mạng và 5xx)
curl https://api.arzastore.com/v1/chat/completions --retry 3 --retry-delay 1 --retry-all-errors -H "Authorization: Bearer sk-your-api-key" -H "Content-Type: application/json" -d '{"model":"gpt-4o","messages":[{"role":"user","content":"hi"}]}'