API Overview
Base URLs, authentication, endpoints, limits, and error format for AnyPath APIs.
On this page
AnyPath exposes a small public gateway surface over platform-priced shared AI capacity.
Base URLs
| Protocol | Base URL | Use when |
|---|---|---|
| OpenAI-compatible | https://api.anypath.dev/v1 | Chat Completions, Responses, model discovery, and images |
| Anthropic Messages | https://api.anypath.dev | Native Anthropic Messages request shapes |
Gemini /v1beta | https://api.anypath.dev/v1beta | Gemini-compatible REST request shapes |
Authentication
| Protocol | Supported auth |
|---|---|
| OpenAI-compatible | Authorization: Bearer sk-... |
| Anthropic Messages | Authorization: Bearer sk-... or x-api-key: sk-... |
Gemini /v1beta | Authorization: Bearer sk-..., x-goog-api-key: sk-..., or ?key=sk-... |
See Authentication for key handling and error responses.
Available endpoints
OpenAI-compatible
| Endpoint | Method | Description |
|---|---|---|
/v1/models | GET | Model discovery for the current API key and route policy |
/v1/routes | GET | Public route catalog for the gateway contract |
/v1/chat/completions | POST | Chat Completions request shape |
/v1/responses | POST | Responses request shape |
/v1/images/generations | POST | Image generation |
/v1/images/edits | POST | Image editing |
Anthropic Messages
| Endpoint | Method | Description |
|---|---|---|
/v1/messages | POST | Claude-native Messages request shape |
/v1/messages/count_tokens | POST | Anthropic-compatible token count request shape |
Gemini /v1beta
| Endpoint | Method | Description |
|---|---|---|
/v1beta/models | GET | List Gemini-compatible models |
/v1beta/models/{model} | GET | Get Gemini-compatible model metadata |
/v1beta/models/{model}:generateContent | POST | Generate content |
/v1beta/models/{model}:streamGenerateContent | POST | Stream generated content |
/v1beta/models/{model}:countTokens | POST | Gateway token estimate for Gemini-compatible request bodies |
Rate limits
The account tier sets the account policy, while each API key can narrow model access, route policy, budget, RPM, and TPM. The API key route policy controls whether AnyPath uses intelligent routing or stays inside a specified provider. Read /v1/models and Console limits for the current effective RPM/TPM values.
When a request exceeds its limit, the gateway returns 429 with a Retry-After hint.
See Rate Limits for retry behavior.
Error response format
OpenAI-compatible gateway errors use this envelope:
{
"error": {
"message": "Invalid API key",
"type": "auth_invalid",
"code": "auth_invalid"
}
}
At runtime type equals code. See Error Codes for the full registry.
Routing and settlement
Requests use routes available to the API key:
- Shared capacity settles in USDT after successful requests.
- Shared-route pricing is derived from official model price and the current provider-level multiplier.
- Route policy and availability determine which models the key can use.