API Keys
Your API keys are the primary way to authenticate with llm.kiwi. You can manage your keys in the Developer Dashboard.[!WARNING] Keep your API keys confidential. Do not share them in public repositories, client-side code, or insecure environments.
Key Format
llm.kiwi API keys follow a standard format:sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Using Your API Key
Include your API key in theAuthorization header of every HTTP request.
Authorization Header
The API uses the standard Bearer token authentication scheme.Examples
Security Best Practices
To keep your account and data secure, follow these industry-standard security practices:- Environment Variables: Never hardcode API keys. Use
.envfiles or secret management systems. - Server-Side Only: Access the API from your backend. Client-side requests expose your key to users.
- Key Rotation: Delete and regenerate keys periodically to minimize the impact of potential leaks.
- Scoped Access: Use different keys for development, staging, and production environments.
Authentication Errors
If there is an issue with your credentials, the API will return a401 Unauthorized response.
| Error Code | Description |
|---|---|
invalid_api_key | The key provided is not recognized by the system. |
expired_api_key | The API key has reached its expiration date or has been revoked. |
missing_api_key | No key was provided in the Authorization header. |