API Overview
AllToken REST API basics — authentication, base URL, and response format.
Base URL
Base URL
$ https://api.alltoken.ai/v1This is the base URL for all endpoints. The API is OpenAI-compatible.
Authentication
All requests require a Bearer token in the Authorization header:
Header
$ Authorization: Bearer YOUR_API_KEYCreate and manage API keys in Settings → API Keys.
Response format
All responses are JSON. Errors follow this format:
Error response
| 1 | { |
| 2 | "error": { |
| 3 | "message": "Invalid API key provided", |
| 4 | "type": "authentication_error", |
| 5 | "code": 401 |
| 6 | } |
| 7 | } |
Status codes
200— Success400— Bad request (invalid parameters)401— Unauthorized (invalid or missing API key)403— Forbidden (insufficient permissions)404— Resource not found429— Rate limit exceeded500— Internal server error502/503— Upstream provider error (may trigger automatic fallback)