Docs

API Overview

Base URLs, authentication, endpoints, limits, and error format for AnyPath APIs.

On this page
  1. Base URLs
  2. Authentication
  3. Available endpoints
  4. OpenAI-compatible
  5. Anthropic Messages
  6. Gemini /v1beta
  7. Rate limits
  8. Error response format
  9. Routing and settlement

AnyPath exposes a small public gateway surface over platform-priced shared AI capacity.

Base URLs

ProtocolBase URLUse when
OpenAI-compatiblehttps://api.anypath.dev/v1Chat Completions, Responses, model discovery, and images
Anthropic Messageshttps://api.anypath.devNative Anthropic Messages request shapes
Gemini /v1betahttps://api.anypath.dev/v1betaGemini-compatible REST request shapes

Authentication

ProtocolSupported auth
OpenAI-compatibleAuthorization: Bearer sk-...
Anthropic MessagesAuthorization: Bearer sk-... or x-api-key: sk-...
Gemini /v1betaAuthorization: Bearer sk-..., x-goog-api-key: sk-..., or ?key=sk-...

See Authentication for key handling and error responses.

Available endpoints

OpenAI-compatible

EndpointMethodDescription
/v1/modelsGETModel discovery for the current API key and route policy
/v1/routesGETPublic route catalog for the gateway contract
/v1/chat/completionsPOSTChat Completions request shape
/v1/responsesPOSTResponses request shape
/v1/images/generationsPOSTImage generation
/v1/images/editsPOSTImage editing

Anthropic Messages

EndpointMethodDescription
/v1/messagesPOSTClaude-native Messages request shape
/v1/messages/count_tokensPOSTAnthropic-compatible token count request shape

Gemini /v1beta

EndpointMethodDescription
/v1beta/modelsGETList Gemini-compatible models
/v1beta/models/{model}GETGet Gemini-compatible model metadata
/v1beta/models/{model}:generateContentPOSTGenerate content
/v1beta/models/{model}:streamGenerateContentPOSTStream generated content
/v1beta/models/{model}:countTokensPOSTGateway 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.