AvalAI API Pricing
📞 Support & Feedback
Need help or found an issue with this documentation? Contact our support team on Telegram: t.me/AvalAISupport
We're here to assist with technical questions, billing inquiries, and documentation improvements.
At AvalAI, we believe in full transparency. Our pricing is 100% aligned with the base API rates of the original providers, ensuring you always get fair and competitive costs without any hidden markups from our core services.
Important
AvalAI pricing is based on standard API token usage, similar to the official Anthropic API, OpenAI API Platform, OpenRouter.ai, and other pay-as-you-go API services. It is not the same as consumer or CLI subscriptions such as Claude Pro/Max or Codex subscriptions, where access may be bundled with a product and usage rules can differ from token-based API billing.
Free credit for new AvalAI users
New users can receive up to 200,000 Tomans of free API credit without making a payment:
- Register with a phone number and verify it: receive 200,000 Tomans in free credit.
- Register with email first: receive 25,000 Tomans in free credit immediately.
- Connect and verify a phone later: receive another 175,000 Tomans, bringing the total free signup credit to 200,000 Tomans.
The phone-verification reward tops the account up to a 200,000-Toman total signup credit; it does not add 200,000 Tomans on top of the initial email credit. Create and verify your account in the AvalAI Dashboard, then use the free balance to test supported API models before topping up.
For complete details on all models and their capabilities, please visit our Model Details page.
For implementation patterns that reduce spend across model choice, token budgets, prompt caching, async work, and flex routing, see Cost Optimization.
Get the Live Model Catalog
Use the public endpoint to retrieve the current model list and its pricing metadata. It requires no API key. The response includes the same model IDs and nested pricing fields used by this page.
# Save the response to models.json instead of printing it to the terminal.
curl --fail --silent --show-error \
https://api.avalai.ir/public/models \
--output models.json# Windows PowerShell: save the response to models.json
Invoke-RestMethod -Uri "https://api.avalai.ir/public/models" `
-OutFile "models.json"import requests
response = requests.get(
"https://api.avalai.ir/public/models",
timeout=30,
)
response.raise_for_status()
models = response.json()["data"]
for model in models:
print(model["id"], model.get("pricing", {}))
# Rate limits for your account tier (e.g. tier 2)
tier_limits = model.get("tier_rate_limits", {}).get("2", {})
print(
" tier 2:",
tier_limits.get("max_requests_per_1_minute"),
"RPM",
tier_limits.get("max_tokens_per_1_minute"),
"TPM",
)Response shape
The top-level response is a model list:
{
"object": "list",
"data": [
{
"id": "example-model",
"object": "model",
"owned_by": "provider",
"min_tier": 0,
"mode": "chat",
"pricing": {
"input": 1.25,
"input_above_128K": 2.5,
"cached_input": 0.125,
"output": 10.0,
"output_above_128K": 15.0
},
"max_input_tokens": 200000,
"max_output_tokens": 32000,
"max_requests_per_1_minute": 1000,
"max_tokens_per_1_minute": 2000000,
"tier_rate_limits": {
"0": {
"max_requests_per_1_minute": 1,
"max_tokens_per_1_minute": 40000
},
"1": {
"max_requests_per_1_minute": 50,
"max_tokens_per_1_minute": 500000
},
"2": {
"max_requests_per_1_minute": 250,
"max_tokens_per_1_minute": 1000000
},
"3": {
"max_requests_per_1_minute": 1000,
"max_tokens_per_1_minute": 2000000
}
},
"supported_endpoints": [
"/v1/chat/completions"
],
"supports_vision": true,
"supports_function_calling": true
}
]
}Important fields:
| Field | Meaning |
|---|---|
id | Exact model name to send in API requests and the model's documentation route. |
owned_by | Model owner or provider shown in the pricing catalog. |
mode | Billing/operation category such as chat, embedding, image_generation, video_generation, audio_transcription, audio_speech, ocr, rerank, or search. |
min_tier | Minimum AvalAI account tier required for access. The tier_rate_limits object always starts at this tier. |
pricing.input, pricing.cached_input, pricing.output | USD price per 1 million tokens. |
pricing.*_above_* | Dynamic long-context rate after the token threshold embedded in the key, such as input_above_128K. |
pricing.input_cost_per_page | OCR processing cost per page. |
pricing.input_cost_per_annotation_page | OCR annotation cost per page. |
pricing.output_cost_per_image_* | Per-image price; a suffix identifies a resolution or quality variant. |
pricing.output_cost_per_video_per_second_* | Per-second video price; a suffix identifies a resolution. |
max_input_tokens, max_output_tokens | Published input and output token limits when available. |
max_requests_per_1_minute, max_tokens_per_1_minute | The model's highest available rate limits (requests per minute and tokens per minute), matching the top tier the model exposes. |
tier_rate_limits | Per-tier rate limits keyed by AvalAI account tier ("0"–"5"). Each entry provides max_requests_per_1_minute (RPM) and max_tokens_per_1_minute (TPM) for that tier. Higher tiers unlock higher throughput. |
supported_endpoints | API routes supported by the model. |
supports_* | Capability flags such as vision, function calling, audio, PDF input, caching, and structured output. |
Pricing fields vary by model mode. Always inspect the complete pricing object instead of assuming every model has only input and output token rates. Rate limits vary by your account tier; use tier_rate_limits to plan throughput for your own tier rather than assuming the top-level maximum.
How Billing Is Calculated
Use the tables below for planning, then verify production spend with the User API because final cost can include more than visible output tokens.
Reasoning-token billing: For every provider and model, hidden
reasoning_tokensare billed at the selected model's output-token rate even though they are not visible in the response text. Whenoutput_tokensalready includes reasoning tokens,output_tokens_details.reasoning_tokensis only a breakdown; do not add the two fields or you will double-count the cost. If a route reports visible output and reasoning separately, add those token counts and apply the same output-token rate to both.
- Model tokens: input, cached input, output, and hidden reasoning tokens are billed according to the selected model and provider.
- Route features: Responses, Chat Completions, Batch, image, audio, video, and tool workflows may expose different fields, but the billable unit still comes from the model, media unit, provider route, service tier, or tool call.
- Hosted tools: built-in tools such as web search, file search, hosted containers, and code-interpreter-style runtimes can add separate call, storage, or session charges when enabled for your route.
- Provider rules: some providers charge cache creation, long-context uplifts, media seconds, image units, or account-tier-specific rates in addition to base token prices.
- Operational controls: set token budgets, prefer cached prefixes for repeated context, choose
service_tierdeliberately, and logavalai-request-idso finance and support teams can reconcile exact transactions.
Flex Service Tier
The Flex Service Tier offers 50% reduced costs compared to the default tier for select OpenAI models. This pricing tier provides significant savings for high-volume API usage.
⚠️ Important Considerations
The flex service tier has higher latency compared to the default tier. Requests may take longer to process, time out, or fail during processing.
- For faster processing of API requests, use the default (standard) service tier (
"default")- For lower prices with higher latency, use the flex processing tier (
"flex")- Server timeout: Flex requests may take up to 900 seconds (15 minutes) to complete
- Production usage: For time-sensitive applications, we recommend implementing a retry mechanism with fallback to
service_tier: "default"- Priority compatibility: OpenAI examples may mention
service_tier: "priority"; usedefaulton AvalAI unless priority processing is explicitly enabled for your account
How It Works
- Default behavior: All requests use the
"default"service tier unless otherwise specified - Opt-in: Send
"service_tier": "flex"in your request to use flex pricing - Model validation: Server rejects requests with
service_tier: "flex"for unsupported models - Response field: All API responses include a
"service_tier"field indicating which tier was used - Supported public values: AvalAI's generally available values are
"default"and"flex"; treat"priority"as account-specific until documented for your route
Flex Tier Pricing
Prices are listed per 1 million tokens. These represent 50% savings compared to default tier pricing.
| Model | Input ($/1M tokens) | Cached Input ($/1M tokens) | Output ($/1M tokens) |
|---|---|---|---|
gpt-5.2 | $0.875 | $0.0875 | $7.00 |
gpt-5.1 | $0.625 | $0.0625 | $5.00 |
gpt-5 | $0.625 | $0.0625 | $5.00 |
gpt-5-mini | $0.125 | $0.0125 | $1.00 |
gpt-5-nano | $0.025 | $0.0025 | $0.20 |
o3 | $1.00 | $0.25 | $4.00 |
o4-mini | $0.55 | $0.275 | $2.20 |
Usage Example
curl -i https://api.avalai.ir/v1/chat/completions \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5-mini",
"messages": [{"role": "user", "content": "Hello!"}],
"stream": false,
"service_tier": "flex"
}'Example Response:
{
"id": "chatcmpl-123",
"created": 1765789075,
"model": "gpt-5-mini-2025-08-07",
"object": "chat.completion",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "Hi — how can I help you today?",
"role": "assistant"
}
}
],
"usage": {
"completion_tokens": 123,
"prompt_tokens": 7,
"total_tokens": 130
},
"service_tier": "flex",
"estimated_cost": {
"unit": "0.0001238750",
"irt": 16.27,
"exchange_rate": 131350
}
}⚠️ Important: Credit Packages and Flex Tier
Credit packages do NOT cover flex service tier costs. When using
service_tier: "flex", costs are charged to your default account balance, not deducted from credit package allocations. Credit packages only apply to default service tier usage.
September 11 model pricing update
The catalog below includes deepseek-v4.1-flash, grok-4.6, gpt-image-2.5-flare, and gpt-image-2.5-sunburst. Prices in this section are in USD.
- DeepSeek V4.1 Flash: $0.15 input, $0.003 cached input, and $0.60 output per 1M tokens. These are fixed off-peak rates at all hours; there is no peak surcharge or further halving. Starting September 14, 2026 at 04:00 UTC,
deepseek-v4-prowill route todeepseek-v4.1-flashand use these rates. The V4-Pro catalog row describes pre-cutover pricing. Use V4.1 Flash now and test before the change. - Grok 4.6: Up to and including 200K input tokens, rates are $2.00 input, $0.50 cached input, and $6.00 output per 1M tokens. Above 200K input tokens, rates are $4.00, $1.00, and $12.50 respectively.
- GPT Image 2.5 Flare and Sunburst: Both use $5.00 text input, $1.25 cached text input, $8.00 image input, $2.00 cached image input, $0.00 text output, and $30.00 image output per 1M tokens. The zero text-output rate does not make image generation free.
GPT Image 2.5 output-image estimates
These estimates apply to one 1024x1024 output image for either model. Add prompt and reference-image input costs to estimate the full request; these are not flat per-edit fees.
| Quality | gpt-image-2.5-flare | gpt-image-2.5-sunburst |
|---|---|---|
low | $0.00588 | $0.00588 |
medium | $0.01317 | $0.01317 |
high | $0.05268 | $0.05268 |
xhigh | $0.09366 | $0.09366 |
max | $0.21072 | $0.21072 |
See the model announcement and migration guidance and Images API cost notes.
Model Pricing Overview
This catalog is generated from data/models.json, which is the authoritative source for model availability and pricing. Each current model ID appears once. Token prices are per 1 million tokens unless another unit is shown.
Prices labeled above N tokens apply when the provider's billed context crosses that threshold. Media dimensions, quality variants, OCR annotation pages, searches, and other units are listed independently when present. GLM-5.3-Flash promotion: The listed $0.075 input, $0.015 cached-input, and $0.25 output rates apply through September 9, 2026; standard rates after that date are $0.15 input, $0.03 cached input, and $0.50 output. Gemini 3.8 Flash promotion: The listed $0.75 input, $0.075 cached-input, and $3.75 output rates for
gemini-3.8-flashand itsgemini-flash-latestalias apply through December 31, 2026; standard rates after that date are $1.50 input, $0.15 cached input, and $7.50 output.
The Rate limits column lists the per-minute request (RPM) and token (TPM) ceilings for each AvalAI account tier, sourced from the
tier_rate_limitsobject. Higher tiers unlock higher throughput. Tiers below a model'smin_tierare marked No access because the model is not available on those tiers.
Chat, Responses & Completion Models
| Model ID | Provider | Pricing details | Rate limits |
|---|---|---|---|
deepseek-v4.1-flash | deepseek | Input$0.15 / 1M tokensCached input$0.003 / 1M tokensOutput$0.60 / 1M tokens | Basic3 RPM · 40K TPMTier 150 RPM · 1M TPMTier 2500 RPM · 4M TPMTier 31500 RPM · 8M TPMTier 42500 RPM · 8M TPMTier 510K RPM · 50M TPM |
gpt-6-astra | openai | Input$10 / 1M tokensInput above 272K tokens$20 / 1M tokensCached input$1 / 1M tokensCached input above 272K tokens$2 / 1M tokensCache creation input$12.50 / 1M tokensCache creation input above 272K tokens$25 / 1M tokensOutput$50 / 1M tokensOutput above 272K tokens$75 / 1M tokensSearch context (low)$0.03 / querySearch context (medium)$0.035 / querySearch context (high)$0.05 / query | BasicNo accessTier 12 RPM · 80K TPMTier 225 RPM · 1M TPMTier 375 RPM · 2M TPMTier 4500 RPM · 8M TPMTier 53500 RPM · 30M TPM |
gemini-3.8-flash | Input$0.75 / 1M tokensCached input$0.075 / 1M tokensOutput$3.75 / 1M tokens | Basic1 RPM · 40K TPMTier 150 RPM · 500K TPMTier 2250 RPM · 1M TPMTier 31K RPM · 2M TPMTier 43500 RPM · 5M TPMTier 525K RPM · 30M TPM | |
claude-fable-5-1 | anthropic | Input$10 / 1M tokensCached input$0.25 / 1M tokensCache creation input$12.50 / 1M tokensOutput$50 / 1M tokens | BasicNo accessTier 1No accessTier 225 RPM · 450K TPMTier 350 RPM · 800K TPMTier 4100 RPM · 1M TPMTier 5150 RPM · 4M TPM |
glm-5.3-flash | zai | Input$0.075 / 1M tokensCached input$0.015 / 1M tokensOutput$0.25 / 1M tokens | Basic3 RPM · 40K TPMTier 125 RPM · 10M TPMTier 2250 RPM · 4M TPMTier 3500 RPM · 8M TPMTier 4750 RPM · 10M TPMTier 51500 RPM · 30M TPM |
glm-5.3 | zai | Input$1.40 / 1M tokensCached input$0.26 / 1M tokensOutput$4.40 / 1M tokens | Basic3 RPM · 40K TPMTier 125 RPM · 10M TPMTier 2250 RPM · 4M TPMTier 3500 RPM · 8M TPMTier 4750 RPM · 10M TPMTier 51500 RPM · 30M TPM |
gemini-3.7-flash | Input$0.75 / 1M tokensCached input$0.075 / 1M tokensOutput$3.75 / 1M tokens | Basic1 RPM · 40K TPMTier 150 RPM · 500K TPMTier 2250 RPM · 1M TPMTier 31K RPM · 2M TPMTier 43500 RPM · 5M TPMTier 525K RPM · 30M TPM | |
qwen3.8-flash | alibaba | Input$0.15 / 1M tokensCache creation input$0.20 / 1M tokensCached input$0.016 / 1M tokensOutput$0.47 / 1M tokens | Basic3 RPM · 40K TPMTier 120 RPM · 500K TPMTier 2150 RPM · 2M TPMTier 3350 RPM · 4M TPMTier 4750 RPM · 8M TPMTier 51500 RPM · 20M TPM |
qwen3.8-27b | alibaba | Input$0.50 / 1M tokensCache creation input$0.625 / 1M tokensCached input$0.10 / 1M tokensOutput$2 / 1M tokens | Basic3 RPM · 40K TPMTier 120 RPM · 500K TPMTier 2150 RPM · 2M TPMTier 3350 RPM · 4M TPMTier 4750 RPM · 8M TPMTier 51500 RPM · 20M TPM |
qwen3.8-2.4t-a95b | alibaba | Input$2 / 1M tokensCache creation input$2.50 / 1M tokensCached input$0.25 / 1M tokensOutput$6 / 1M tokens | BasicNo accessTier 120 RPM · 500K TPMTier 2150 RPM · 2M TPMTier 3350 RPM · 4M TPMTier 4750 RPM · 8M TPMTier 51500 RPM · 20M TPM |
qwen3.8-max | alibaba | Input$2 / 1M tokensCache creation input$2.50 / 1M tokensCached input$0.25 / 1M tokensOutput$6 / 1M tokens | BasicNo accessTier 110 RPM · 100K TPMTier 250 RPM · 450K TPMTier 3150 RPM · 1M TPMTier 4350 RPM · 2M TPMTier 5750 RPM · 4M TPM |
claude-opus-5 | anthropic | Input$5 / 1M tokensCached input$0.50 / 1M tokensCache creation input$6.25 / 1M tokensOutput$25 / 1M tokens | BasicNo accessTier 12 RPM · 30K TPMTier 225 RPM · 450K TPMTier 350 RPM · 800K TPMTier 4100 RPM · 1M TPMTier 5150 RPM · 4M TPM |
gemini-3.6-flash | Input$1.50 / 1M tokensCached input$0.15 / 1M tokensOutput$7.50 / 1M tokens | Basic1 RPM · 40K TPMTier 150 RPM · 500K TPMTier 2250 RPM · 1M TPMTier 31K RPM · 2M TPMTier 43500 RPM · 5M TPMTier 525K RPM · 30M TPM | |
gemini-3.5-flash-lite | Input$0.30 / 1M tokensCached input$0.03 / 1M tokensOutput$2.50 / 1M tokens | Basic3 RPM · 40K TPMTier 150 RPM · 500K TPMTier 2500 RPM · 1M TPMTier 31K RPM · 3M TPMTier 43500 RPM · 5M TPMTier 525K RPM · 20M TPM | |
kimi-k3 | moonshot | Input$3 / 1M tokensCached input$0.30 / 1M tokensOutput$15 / 1M tokensSearch context (low)$0.005 / querySearch context (medium)$0.005 / querySearch context (high)$0.01 / query | Basic3 RPM · 40K TPMTier 150 RPM · 1M TPMTier 2100 RPM · 4M TPMTier 3250 RPM · 8M TPMTier 4500 RPM · 10M TPMTier 55K RPM · 30M TPM |
gpt-5.6-sol | openai | Input$5 / 1M tokensInput above 272K tokens$10 / 1M tokensCached input$0.50 / 1M tokensCached input above 272K tokens$1 / 1M tokensCache creation input$2.50 / 1M tokensCache creation input above 272K tokens$12.50 / 1M tokensOutput$12 / 1M tokensOutput above 272K tokens$45 / 1M tokensSearch context (low)$0.03 / querySearch context (medium)$0.035 / querySearch context (high)$0.05 / query | Basic1 RPM · 10K TPMTier 150 RPM · 500K TPMTier 2150 RPM · 2M TPMTier 3250 RPM · 4M TPMTier 41500 RPM · 8M TPMTier 510K RPM · 20M TPM |
gpt-5.6-terra | openai | Input$2 / 1M tokensInput above 272K tokens$4 / 1M tokensCached input$0.20 / 1M tokensCache creation input$2.50 / 1M tokensCached input above 272K tokens$0.40 / 1M tokensCache creation input above 272K tokens$5 / 1M tokensOutput$12 / 1M tokensOutput above 272K tokens$18 / 1M tokensSearch context (low)$0.03 / querySearch context (medium)$0.035 / querySearch context (high)$0.05 / query | Basic1 RPM · 10K TPMTier 150 RPM · 500K TPMTier 2150 RPM · 2M TPMTier 3250 RPM · 4M TPMTier 41500 RPM · 8M TPMTier 510K RPM · 20M TPM |
Embedding Models
| Model ID | Provider | Pricing details | Rate limits |
|---|
Image Generation Models
| Model ID | Provider | Pricing details | Rate limits |
|---|
Video Generation Models
| Model ID | Provider | Pricing details | Rate limits |
|---|
Audio Transcription Models
| Model ID | Provider | Pricing details | Rate limits |
|---|
Text-to-Speech Models
| Model ID | Provider | Pricing details | Rate limits |
|---|
OCR Models
| Model ID | Provider | Pricing details | Rate limits |
|---|
Moderation Models
| Model ID | Provider | Pricing details | Rate limits |
|---|
Reranking Models
| Model ID | Provider | Pricing details | Rate limits |
|---|
Search Models
| Model ID | Provider | Pricing details | Rate limits |
|---|
Built-in Tools
Built-in tools are not model IDs and therefore are not sourced from the model catalog. Tokens consumed by a tool are still billed at the selected model's rates.
| Tool | Cost | Notes |
|---|---|---|
| Code Interpreter | $0.03 / session | |
| File Search Storage | $0.10 / GB/day | First 1 GB free |
| File Search Tool Call | $2.50 / 1,000 calls | Responses API |
Cost Tracking
AvalAI provides two methods for tracking API costs:
1. Estimated Cost (Basic)
API responses include an optional estimated_cost dictionary for quick cost estimation:
| Field | Description |
|---|---|
unit | Cost in USD/USDT |
irt | Cost in Tomans (IRT), calculated as USD cost × USDT-IRT exchange rate |
exchange_rate | Current USDT-IRT exchange rate used for the conversion |
Example API response with estimated cost:
{
"id": "response-123456",
"object": "chat.completion",
"created": 1714911234,
"model": "gpt-4o",
"choices": [...],
"usage": {
"prompt_tokens": 42,
"completion_tokens": 128,
"total_tokens": 170
},
"estimated_cost": {
"unit": 0.0025,
"irt": 200,
"exchange_rate": 80000
}
}Important notes:
- This field might not be present in all responses.
- For regular (non-streaming) requests, it's included in the main response.
- For streaming requests, it's attached to the last chunk of the streaming response.
- The estimated cost is not guaranteed and should not be used for billing or accounting purposes.
2. User API (Precise & Guaranteed)
For accurate cost tracking and billing, use the User API at https://api.avalai.ir/user/v1:
Key Features:
- 100% Accurate Costs - Guaranteed precise costs for every API call
- Request ID Tracking - Use
avalai-request-idfrom response headers to lookup exact costs - Available Within 30 Seconds - Costs processed and ready for retrieval
- Transaction History - Complete audit trail with filtering capabilities
- Usage Analytics - Detailed summaries by model, provider, date, or hour
Perfect for:
- Resellers - Accurately charge customers based on actual costs
- Enterprises - Precise cost allocation and chargeback
- Production Apps - Reliable billing and usage monitoring
Quick Example:
# 1. Make API call and get avalai-request-id from response headers
curl -i "https://api.avalai.ir/v1/chat/completions" \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-4o-mini", "messages": [{"role": "user", "content": "hi"}]}'
# Response includes: avalai-request-id: 019ac4a0-a8f4-7041-845f-3ea8f15dcf1a
# 2. Get precise cost (available within 30 seconds)
curl "https://api.avalai.ir/user/v1/transactions/lookup" \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"transaction_ids": ["019ac4a0-a8f4-7041-845f-3ea8f15dcf1a"]}'Learn More:
- User API Documentation - Complete API reference
- Reseller Cost Tracking Guide - Step-by-step implementation guide
- Enterprise Usage Guide - Advanced patterns for scale