1,000+ AI models. Top up with bKash, Nagad or card. Prepaid, no surprises.
Base URL: https://allaizone.com/v1
curl https://allaizone.com/v1/chat/completions \
-H "Authorization: Bearer $ALLAIZONE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [{"role": "user", "content": "Write a haiku about the Padma river."}],
"max_tokens": 300
}'
// npm install openai
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://allaizone.com/v1",
apiKey: process.env.ALLAIZONE_API_KEY,
});
const r = await client.chat.completions.create({
model: "anthropic/claude-sonnet-4",
messages: [{ role: "user", content: "Explain bKash in one sentence." }],
max_tokens: 300,
});
console.log(r.choices[0].message.content);
# pip install openai
import os
from openai import OpenAI
client = OpenAI(base_url="https://allaizone.com/v1", api_key=os.environ["ALLAIZONE_API_KEY"])
r = client.chat.completions.create(
model="google/gemini-2.5-flash",
messages=[{"role": "user", "content": "Translate 'good morning' into Bangla."}],
max_tokens=200,
)
print(r.choices[0].message.content)
Send your key in the Authorization header: Bearer az-... Keys are shown once when you create them; we store only a hash. Revoke a key at any time from the dashboard. Each key can have its own spending limit.
GET /v1/models returns the live list of models with our prices (USD per token, plus per-million prices in USD and BDT). Use the model id exactly as listed, for example openai/gpt-4o-mini or anthropic/claude-sonnet-4.
curl https://allaizone.com/v1/models
POST /v1/chat/completions accepts the OpenAI request body (model, messages, max_tokens, temperature, tools, response_format and so on). The response is in the OpenAI format. Every response carries these headers:
| Header | Meaning |
|---|---|
x-az-charged | Amount charged for this request, in your account currency. |
x-az-balance | Your balance after this request. |
x-az-currency | BDT or USD. |
x-az-model | The model that answered (useful with fallback). |
Set "stream": true to receive server-sent events exactly like OpenAI. The final event includes token usage. If you stop reading early, you pay only for what was generated.
const stream = await client.chat.completions.create({
model: "openai/gpt-4o-mini",
messages: [{ role: "user", content: "Tell me a short story." }],
stream: true,
});
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content || "");
Add a "models" array (or the header x-fallback-models: a,b) with up to 3 backup models. If the first model fails with a server error, a rate limit or a timeout, we try the next one automatically. You are charged only for the model that answered.
{
"model": "anthropic/claude-sonnet-4",
"models": ["openai/gpt-4o-mini", "google/gemini-2.5-flash"],
"messages": [{"role": "user", "content": "Hello"}]
}
You pay the provider's price per token plus a {margin}% platform margin. Taka accounts are charged in BDT at 1 USD = {rate} BDT. Exact prices for every model are in GET /v1/models.
Top-ups are credited 1:1 in the currency you pay (minimum Tk 500 or $5). Your first top-up fixes your account currency.
Errors use the OpenAI format: {"error": {"message", "type", "code"}}.
| Status | Type | Meaning |
|---|---|---|
| 401 | invalid_api_key | The key is missing, wrong or revoked. |
| 402 | insufficient_balance | Your balance is too low for this request. Top up at allaizone.com/developers. |
| 402 | spending_limit_reached | This key reached the spending limit you set. |
| 404 | model_not_found | The model id is not in GET /v1/models. |
| 429 | rate_limit_exceeded | More than {rpm} requests per minute on one key. Wait for the Retry-After seconds. |
| 502 | upstream_error | The model provider failed (after trying your fallback models). You are not charged. |
Save your own OpenAI, Anthropic, Google or OpenRouter key in the dashboard. Requests for that provider then go out with your key, and we charge only a small platform fee per request. Keys are encrypted with AES-GCM and never shown again.