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-5.6-sol",
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-5.6-sol",
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-5.6-sol",
"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: Qwen3.8-MaxUse Alibaba's 1M-context flagship for long-horizon coding, professional work, and multimodal agents.DeepSeek-V4-Flash upgradedThe stable model ID now uses DeepSeek-V4-Flash-0731 automatically at the same price.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.