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.
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.