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
| Usage | URL |
|---|---|
| OpenAI-compatible SDK | https://api.token4ai.cloud/v1 |
| Anthropic SDK / Claude Code | https://api.token4ai.cloud |
| Gemini native REST | https://api.token4ai.cloud/v1beta/models/{model}:generateContent |
| Vega console | https://dash.token4ai.cloud/dashboard |
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.
| Protocol | Header |
|---|---|
| OpenAI / general | Authorization: Bearer <API_KEY> |
| Anthropic | x-api-key: <API_KEY>; anthropic-version: 2023-06-01 |
| Gemini | x-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 family | Required scope |
|---|---|
| Models | models.read |
| Chat / Gemini | chat.completions |
| Responses | responses.create |
| Messages / count_tokens | messages.create |
| Embeddings / Rerank | embeddings.create |
| Images | images.generate |
| Audio | audio.create |
| Files read / write | assets.read / assets.write |
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.