Base URL and authentication
Base URL
Section titled “Base URL”Pick the base URL that matches the format your tool or SDK uses.
| For | Base URL | Endpoints used |
|---|---|---|
| OpenAI-format SDKs and tools | https://api.vikey.ai/v1 |
/chat/completions, /responses, /models |
| Anthropic-format SDKs and tools (including Claude Code) | https://api.vikey.ai |
/v1/messages |
| Token Plan | https://api-plan.vikey.ai/v1 |
Same as the OpenAI format, model vikey/plan |
Sending the API key
Section titled “Sending the API key”Send the key in either header. Both are accepted on every endpoint.
Authorization: Bearer YOUR_API_KEYx-api-key: YOUR_API_KEYThe OpenAI SDK uses Authorization: Bearer and the Anthropic SDK uses x-api-key. You do not need to set these headers yourself when you use an SDK.
Optional headers
Section titled “Optional headers”| Header | Purpose |
|---|---|
X-End-User |
An identifier for your own end user (not a Vikey user), such as a customer id in your app. Stored with the usage data. Use 1 to 128 characters: letters, digits, underscore, period, colon or hyphen. Invalid values are ignored, they never fail the request. Do not put emails or phone numbers here. |
Checking the balance from the API
Section titled “Checking the balance from the API”The balance is shown in the dashboard. GET /v1/balance only accepts a dashboard login token, not an API key, so in an app rely on the dashboard or handle the 402 error (see Errors).