Build with AvalAI
Start with one real request, then follow the documentation path that matches what you are building. AvalAI works with OpenAI-compatible clients through a single base URL.
Make your first request
Use the Responses API to confirm your key, client, and model are working together.
- Create an API keyOpen the AvalAI dashboard, create a project key, and keep it on the server.
- Install a clientUse the OpenAI SDK for Python or JavaScript, or send the same request with cURL.
- Send a Responses requestSet
AVALAI_API_KEY, run the example, and readresponse.output_text.
python
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-6-astra",
input="Give me one practical idea for a developer tool.",
)
print(response.output_text)javascript
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.AVALAI_API_KEY,
baseURL: "https://api.avalai.ir/v1",
});
const response = await client.responses.create({
model: "gpt-6-astra",
input: "Give me one practical idea for a developer tool.",
});
console.log(response.output_text);bash
curl https://api.avalai.ir/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-d '{
"model": "gpt-6-astra",
"input": "Give me one practical idea for a developer tool."
}'Choose a task path
Go directly to the API surface and guides for your workload.
Find a model and understand cost
Compare documented capabilities first, then check current input and output pricing.
Direct Meta: Muse Spark 1.3 and Muse Image 1.0From Tier 1, use
muse-spark-1.3 for reasoning and coding on Chat Completions or Messages, with partial Responses support. muse-image-1.0 supports Images Generations only. These direct meta.ai models have an additional 15% billing-processing fee: billed Spark input/cached-input/output is $1.4375/$0.1725/$4.8875 per million tokens and Image is $0.0115 per image.New Google flagship: Gemini 4 ArgonUse gemini-4-argon for sustained reasoning, coding, and multimodal knowledge work through native Gemini, Chat Completions, Messages, or Responses. USD input/cached-input/output rates are $2.00/$0.10/$10.00 per million tokens through November 30, 2026, then $4.00/$0.20/$20.00 from December 1.Automatic DeepSeek Flash upgradedeepseek-flash and deepseek-v4.1-flash now use DeepSeek-V4.1-Flash-1017. No client-side code changes are necessary and pricing is unchanged: keep your existing ID and integration. USD input/cached-input/output rates remain $0.15/$0.003/$0.60 per million tokens.New: Claude Haiku 5.5Use claude-haiku-5-5 for high-volume summaries, classification, live support, and coding subagents with adjustable effort and Chat Completions, Messages, and Responses support. Input/output rates are $0.10/$0.50 per million tokens through 100K request input tokens and $0.50/$2.50 above 100K; compare cache pricing and migration notes.New: Gemini 3.8 Flash and Flash-Lite TTSChoose Flash for creative narration, accents, and long-form stability, or Lite for high-throughput voice-agent cascades and read-aloud speech. Both support Persian; compare promotional token rates through December 31, 2026 and structured prompting and audio-format migration.New: GPT-6.1 Sol and Claude Sonnet 5.5Build coding and document workflows with gpt-6.1-sol or claude-sonnet-5-5 from Tier 1. Both fully support Chat Completions and Messages; Responses is full for Sol and partial for Sonnet. Standard input/output rates are $2/$10 per million tokens; compare cache pricing and Sonnet's thinking migration.New Anthropic flagship: Claude Opus 5.5Use claude-opus-5-5 for long-running coding and knowledge work with always-on adaptive thinking, a 1M-token input window, and full Chat Completions, Messages, and Responses support. Available from Tier 1; input is $4 and output is $20 per 1 million tokens.New: GPT-6 Sol, GPT-6 Luna, and Grok 4.7Use OpenAI's gpt-6-sol and gpt-6-luna for cost-efficient reasoning, or xAI's grok-4.7 for long-running coding and knowledge work. All support Chat Completions and Messages; Responses support is full for Sol and Luna and partial for Grok.New: GPT Image 2.5, DeepSeek V4.1 Flash, and Grok 4.6Generate and edit with Flare or Sunburst, and build reasoning agents with DeepSeek V4.1 Flash or Grok 4.6. DeepSeek off-peak rates apply around the clock; this earlier release records the separate September 14 V4-Pro routing notice.New OpenAI flagship: GPT-6 AstraUse gpt-6-astra for demanding computer-use, software-engineering, professional, scientific, cybersecurity, and long-context workloads with full Chat Completions, Messages, and Responses support.New Anthropic flagship: Claude Fable 5.1Use claude-fable-5-1 for advanced coding, research, knowledge work, and long-running agents with a 1M-token input window, always-on adaptive thinking, and lower cache-read pricing.New Alibaba models: Qwen3.8-27B and Qwen3.8-FlashUse qwen3.8-flash for cost-efficient vision and agent workloads, or qwen3.8-27b for compact dense vision-language reasoning with flexible thinking control.New Z.AI flagship: GLM-5.3-FlashUse glm-5.3-flash for multimodal coding and agent workflows with 320B total and 18B active parameters, a 991K-token input window, and promotional pricing through September 9, 2026.Z.AI flagship: GLM-5.3Build complex coding and long-horizon agent workflows with mandatory thinking, selectable reasoning effort, and a 1M-token context window.New Alibaba models: Qwen3.8 open weight and Qwen Image 3Use qwen3.8-2.4t-a95b for mandatory-thinking text workloads, or qwen-image-3.0-pro and qwen-image-3.0 for image generation and editing.New: Gemini 3.8 FlashBuild long-horizon coding agents and tool-driven workflows at promotional rates through December 31, 2026. The gemini-flash-latest alias now points to this model.New: Muse Glimmer 30BUse Meta's multimodal agentic model through Fireworks.ai for reasoning, tools, coding, and multilingual work.New: Nemotron 3.5 LightningUse NVIDIA's efficient 30B/3B-active model for reasoning, coding, RAG, and agent workloads.Drastically improved cache routingPer-user and per-model routing now prefers the last-known-good infrastructure for a rolling 15-minute sticky window.Browse modelsCompare model families, modalities, context, and supported endpoints.Review pricingSee current token and media pricing before choosing a production model.Popular guides and developer tasks
Move from a successful request to reliable application behavior.
Return structured dataConstrain responses to a schema your application can validate.Call application functionsLet models request tools while your code controls execution.Stream a responseRender useful output as response events arrive.Prepare for productionPlan for security, reliability, latency, and cost.
Support and service status
Get account or integration help, or check whether an active service event may affect requests.