Introduction
Welcome to the Frost AI API documentation. Access 100+ AI models through a single, unified API.
What is Frost AI?
Frost AI is a unified API gateway that provides access to premium AI models from OpenAI, Anthropic, Google, and more. Use a single API key to access all models with OpenAI-compatible endpoints.
Key Features
Single API Key
One API key for all models. No need to manage multiple accounts.
OpenAI Compatible
Drop-in replacement for OpenAI SDK. Just change the base URL.
10x Credits
Pay $20, get $200 in credits. More value for your money.
Analytics
Track usage, costs, and performance across all models.
Base URL
All API requests should be made to:
https://frostai.xyz/v1
Quick Start
Get up and running with Frost AI in under 5 minutes.
Create an Account
Sign up at frostai.com to create your account. You'll get $10 free credits to start.
Get Your API Key
Navigate to the API Keys section in your dashboard and generate a new key.
Make Your First Request
Use the OpenAI SDK with our base URL:
from openai import OpenAI
# Initialize the client with Frost AI
client = OpenAI(
base_url="https://frostai.xyz/v1",
api_key="your-api-key"
)
# Make a chat completion request
response = client.chat.completions.create(
model="claude-opus-4-5",
messages=[
{"role": "user", "content": "Hello, how are you?"}
]
)
print(response.choices[0].message.content)
Authentication
All API requests require authentication using your API key.
API Keys
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
- Never expose your API key in client-side code
- Use environment variables to store your key
- Rotate your keys regularly
- Use separate keys for development and production
Environment Variables
We recommend storing your API key in an environment variable:
export FROST_API_KEY="your-api-key"
import os
from openai import OpenAI
client = OpenAI(
base_url="https://frostai.xyz/v1",
api_key=os.environ.get("FROST_API_KEY")
)
Credits & Billing
Understand how Frost AI credits work and how you're billed.
10x Credits Bonus
When you purchase credits, you get 10x the amount loaded to your account! Pay $20, get $200 in credits.
How Credits Work
| You Pay | Credits Received | Effective Savings |
|---|---|---|
| $5 | $50 | 90% |
| $10 | $100 | 90% |
| $20 | $200 | 90% |
| $50 | $500 | 90% |
| $100 | $1,000 | 90% |
Credit Usage
Credits are deducted based on token usage at official provider rates:
- Input tokens: Charged per 1M tokens at the model's input rate
- Output tokens: Charged per 1M tokens at the model's output rate
- Credits never expire: Use them at your own pace
Model Pricing
Here are the pricing rates for popular models (per 1M tokens):
| Model | Input ($/1M) | Output ($/1M) |
|---|---|---|
claude-opus-4-5 |
$5.00 | $25.00 |
claude-sonnet-4-5 |
$3.00 | $15.00 |
claude-opus-4 |
$15.00 | $75.00 |
gemini-2.5-pro |
$1.25 | $5.00 |
gemini-2.5-flash |
$0.10 | $0.40 |
Check Your Balance
You can check your credit balance via the API:
curl https://frostai.xyz/v1/account/credits \
-H "Authorization: Bearer your-api-key"
Tier System
Frost AI offers different tiers with varying benefits and rate limits.
Account Tiers
All new accounts start at the Free tier with 10 credits. Upgrade through promo codes or purchases.
Available Tiers
| Tier | Context Window | Requests/min | Requests/hour | Requests/day |
|---|---|---|---|---|
| Free | 32K tokens | 10 | 100 | 500 |
| Basic | 128K tokens | 30 | 500 | 2,000 |
| Pro | Unlimited (model max) | 100 | 2,000 | 10,000 |
| Enterprise | Unlimited (model max) | Unlimited | Unlimited | Unlimited |
What is Context Window?
The context window is the maximum number of tokens (input + output) that can be processed in a single API request. Higher tiers unlock larger context windows, allowing for longer conversations and larger documents.
Context Window Examples
| Token Count | Approximate Text | Use Case |
|---|---|---|
| 32K tokens | ~24,000 words / ~50 pages | Short documents, basic conversations |
| 128K tokens | ~96,000 words / ~200 pages | Medium documents, extended conversations |
| 1M tokens | ~750,000 words / ~1,500 pages | Large codebases, books, comprehensive analysis |
Tier Benefits
Larger Context Windows
Higher tiers unlock larger context windows for longer conversations and documents.
Higher Rate Limits
Higher tiers get more requests per minute, hour, and day.
Premium Models
Pro and Enterprise tiers get access to Claude Opus and other premium models.
Priority Support
Higher tiers receive faster response times and dedicated support channels.
Upgrade Your Tier
You can upgrade your tier in several ways:
- Purchase Credits: Buying larger credit packages may include tier upgrades
- Promo Codes: Use special promo codes for tier upgrades
- Contact Sales: For Enterprise tier, contact our sales team
Promo Codes
Use promo codes to get free credits, tier upgrades, and special discounts.
Promo Code Format
Promo codes follow the format: FROST-XXXX-XXXX. Enter them in your Dashboard.
Types of Promo Codes
| Type | Description | Example Benefit |
|---|---|---|
| Credits | Adds free credits to your account | +$50 credits |
| Tier Upgrade | Upgrades your account tier | Free → Pro |
| Discount | Percentage discount on credit purchases | 20% off next purchase |
| Free Trial | Temporary access to higher tier features | 7 days Pro access |
How to Use Promo Codes
Go to Dashboard
Log in to your account and navigate to your Dashboard.
Find the Promo Code Section
Look for the "Promosyon Kodu" (Promo Code) section with the gift icon.
Enter Your Code
Type in your promo code in the format FROST-XXXX-XXXX and click "Kodu Kullan".
- Each code can only be used once per account
- Codes may have expiration dates
- Some codes have usage limits (e.g., first 100 users)
- Codes cannot be combined with other offers
Account Approval
Learn about the account approval process and whitelist system.
Whitelist System
Frost AI uses a whitelist system to ensure quality and prevent abuse. New accounts may require admin approval.
Approval Process
Register
Create your account with a valid email address.
Pending Approval
If whitelist is enabled, your account will be in "pending approval" status.
Admin Review
An admin will review and approve your account.
Access Granted
Once approved, you can access all features based on your tier.
What Happens While Pending?
- You can log in but will see a "Pending Approval" screen
- You cannot access the Dashboard or make API calls
- Your API keys are created but won't work until approved
- You'll receive an email notification once approved
Need Faster Approval?
Contact our support team with your use case for expedited review:
- Email: support@frostai.xyz
- Discord: Join our community server
- Support Ticket: Create a ticket in the Dashboard (after approval)
Chat Completions
Create chat completions with any supported model.
Endpoint
/v1/chat/completions
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
model |
string | Yes | ID of the model to use (e.g., "claude-opus-4-5") |
messages |
array | Yes | Array of message objects with role and content |
temperature |
number | No | Sampling temperature (0-2). Default: 1 |
max_tokens |
integer | No | Maximum tokens to generate |
stream |
boolean | No | Enable streaming responses. Default: false |
top_p |
number | No | Nucleus sampling parameter |
Example Request
response = client.chat.completions.create(
model="claude-opus-4-5",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"}
],
temperature=0.7,
max_tokens=1000
)
Example Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1702488000,
"model": "claude-opus-4-5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The capital of France is Paris."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 8,
"total_tokens": 33
}
}
Streaming
Receive responses as they're generated for better user experience.
Enable Streaming
Set stream: true in your request to receive Server-Sent Events (SSE):
stream = client.chat.completions.create(
model="claude-opus-4-5",
messages=[{"role": "user", "content": "Tell me a story"}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
const stream = await client.chat.completions.create({
model: 'claude-opus-4-5',
messages: [{ role: 'user', content: 'Tell me a story' }],
stream: true
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content || '');
}
Error Handling
Learn how to handle API errors gracefully.
Error Response Format
{
"error": {
"message": "Invalid API key provided",
"type": "authentication_error",
"code": "invalid_api_key"
}
}
Common Error Codes
| Code | Status | Description |
|---|---|---|
401 |
Unauthorized | Invalid or missing API key |
402 |
Payment Required | Insufficient credits |
403 |
Forbidden | No access to premium model |
413 |
Payload Too Large | Context window limit exceeded for your tier |
429 |
Too Many Requests | Rate limit exceeded |
500 |
Internal Server Error | Server error, retry later |
503 |
Service Unavailable | Model temporarily unavailable |
Context Limit Error
When your request exceeds your tier's context window limit, you'll receive a 413 error:
{
"error": {
"message": "Context window limit exceeded. Your tier allows 32,768 tokens, but your request contains 45,000 tokens.",
"type": "context_limit_exceeded",
"code": "context_limit_exceeded",
"tier": "free",
"limit": 32768,
"used": 45000,
"exceeded": 12232
}
}
How to resolve context limit errors
- Reduce input: Shorten your messages or remove unnecessary context
- Split requests: Break large documents into smaller chunks
- Upgrade tier: Upgrade to Basic (128K) or Pro (Unlimited)
Handling Errors in Python
from openai import OpenAI, APIError, RateLimitError
try:
response = client.chat.completions.create(
model="claude-opus-4-5",
messages=[{"role": "user", "content": "Hello"}]
)
except RateLimitError:
print("Rate limited. Please wait and retry.")
except APIError as e:
print(f"API error: {e}")
Rate Limits
Understanding and working with API rate limits and context window limits.
Rate Limits by Tier
| Tier | Context Window | Requests/min | Requests/hour | Requests/day |
|---|---|---|---|---|
| Free | 32K tokens | 10 | 100 | 500 |
| Basic | 128K tokens | 30 | 500 | 2,000 |
| Pro | Unlimited | 100 | 2,000 | 10,000 |
| Enterprise | Unlimited | Unlimited | Unlimited | Unlimited |
Rate Limit Headers
Check these headers in API responses:
X-RateLimit-Limit-Minute: Max requests per minuteX-RateLimit-Limit-Hour: Max requests per hourX-RateLimit-Limit-Day: Max requests per dayX-RateLimit-Tier: Your current tierRetry-After: Seconds until you can retry (when rate limited)
Context Limit Headers
When context limit is exceeded (HTTP 413), these headers are included:
X-Context-Limit: Your tier's context window limitX-Context-Used: Tokens in your requestX-Context-Tier: Your current tier
- Rate limits: Implement exponential backoff and retry logic
- Context limits: Reduce input size or upgrade your tier
- Check the
Retry-Afterheader for rate limits - Check
X-Context-Limitfor context window issues
Models API
List and get information about available models.
List Models
/v1/models
models = client.models.list()
for model in models:
print(model.id)