API Overview

AllToken REST API basics — authentication, base URL, and response format.

Base URL

Base URL
$ https://api.alltoken.ai/v1

This 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_KEY

Create 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 — Success
  • 400 — Bad request (invalid parameters)
  • 401 — Unauthorized (invalid or missing API key)
  • 403 — Forbidden (insufficient permissions)
  • 404 — Resource not found
  • 429 — Rate limit exceeded
  • 500 — Internal server error
  • 502/503 — Upstream provider error (may trigger automatic fallback)