Docs

Get started

Authentication, API keys and billing groups

Configure Bearer, Anthropic and Gemini credentials; understand key rotation, scopes and billing groups.

Updated

Choose the correct base URL

UsageURL
OpenAI-compatible SDKhttps://api.token4ai.cloud/v1
Anthropic SDK / Claude Codehttps://api.token4ai.cloud
Gemini native RESThttps://api.token4ai.cloud/v1beta/models/{model}:generateContent
Vega consolehttps://dash.token4ai.cloud/dashboard
SDKs usually append their endpoint path. Use /v1 for an OpenAI base_url and the origin for Anthropic, avoiding /v1/v1.

Credentials and headers

Use one credential mechanism per request. Keep keys out of query strings, logs, screenshots and frontend JavaScript. Browser applications should call their own backend, which in turn calls the model gateway.

ProtocolHeader
OpenAI / generalAuthorization: Bearer <API_KEY>
Anthropicx-api-key: <API_KEY>; anthropic-version: 2023-06-01
Geminix-goog-api-key: <API_KEY>

Groups and access scopes

A key’s provider and billing group determine its available models and pricing. After changing groups, refresh the model list and price table before updating application configuration. Key limits and selectable groups are shown in the current console.

API familyRequired scope
Modelsmodels.read
Chat / Geminichat.completions
Responsesresponses.create
Messages / count_tokensmessages.create
Embeddings / Rerankembeddings.create
Imagesimages.generate
Audioaudio.create
Files read / writeassets.read / assets.write
For a 403, check the key’s granted scopes. A model appearing in the catalog does not grant permission for every endpoint.

Rotate and revoke

If a key is exposed, revoke or rotate it immediately. Update server configuration and restart processes that load environment variables at startup. Validate the new key, then confirm the old credential is disabled. Rotation does not create a new account; reconcile prior usage under the original account.

Related guides