Skip to content

Base URL and authentication

View as Markdown

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

Send the key in either header. Both are accepted on every endpoint.

Authorization: Bearer YOUR_API_KEY
x-api-key: YOUR_API_KEY

The 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.

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.

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).