API Keys
All requests to the Caistro API must include an API key. You can manage your keys in the Console.
Creating an API Key
- Log in to the Console
- Navigate to API Keys
- Click Generate Key
- Copy your key immediately - it won’t be shown again
Using Your API Key
Include your API key in the Authorization header:
Authorization: Bearer cai_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Security Best Practices
Never expose your API key in client-side code or public repositories.
- Store keys in environment variables
- Rotate keys periodically
- Use separate keys for development and production
- Revoke compromised keys immediately
Billing
Caistro uses a credit-based pay-as-you-go model:
| Model | Input | Output |
|---|
Nous-20B | $0.20 / 1M tokens | $0.60 / 1M tokens |
New users receive $1.00 in free credits (approximately 5M input tokens). Free credits are used first before prepaid credits.
Purchase additional credits anytime in the Console.
Rate Limits
When you exceed your rate limit, you’ll receive a 429 Too Many Requests response.
Error Responses
| Status | Description |
|---|
401 | Invalid or missing API key |
402 | Insufficient credits |
403 | Key doesn’t have permission |
429 | Rate limit exceeded |