IN ENGLISH · API DOCS

API billing and pricing

A call costs the model vendor's own USD list price, plus our markup (15% on flagship models, 30% on the small low-cost models, 20% on the rest), times the day's dollar rate in Toman. That amount is taken from a prepaid Toman wallet. 10% VAT is added to every top-up. A failed request is not billed, and credit you buy yourself does not expire.

Last updated:

[01]BILLING AND PRICING

The formula

formulatext
cost_toman = usage × vendor_list_price_usd × (1 + markup) × toman_per_usd
  • usage is tokens, seconds, characters or images, depending on the route.
  • vendor_list_price_usd is the vendor's own published list price. Input, output and cached tokens each have their own rate.
  • The amount of each call is rounded up, and is at least one Toman.
  • Each model's Toman price is on the pricing page and in the model list.
[02]BILLING AND PRICING

The markup by model

Markup
TierMarkupWhich models
FlagshipMarkup:15%Which models:Claude Opus, Fable and Mythos, GPT-5.5, GPT-6 Astra, the -pro models, Gemini Pro, o1 and deep-research
Small, low-costMarkup:30%Which models:deepseek-v4-flash, gemini-2.5-flash, gemini-2.5-flash-lite, gpt-4o-mini, gpt-5-nano, gpt-5.6-luna, gpt-6-luna
Every other modelMarkup:20%Which models:Any other model, including image, audio, video and realtime models
  • Volume rule: an account whose wallet spent more than 5,000,000 Toman in the last 30 days pays at most 15% on every model. It applies automatically.
  • These tiers apply from 27 October 2026; before that the markup was 20% on every model.
  • The markup does not depend on the route: a model costs the same on /v1, /anthropic and /gemini.
[03]BILLING AND PRICING

The dollar rate

The dollar-to-Toman rate is refreshed every day at 9 in the morning, Tehran time, rounded up to the next 100 Toman, and moves by no more than 15% in a day. Today's rate and the time it took effect are printed on the pricing page. Each call is priced at the rate of that moment, and the rate used stays on that call's usage row. The wallet balance is in Toman and does not move with the rate.

[04]BILLING AND PRICING

Top-ups and VAT

Wallet top-ups
WhatValue
Payment methodsValue:the Zarinpal gateway, the Digipay gateway and card-to-card transfer with a receipt
Smallest top-upValue:1,000 Toman
Largest top-upValue:25,000,000 Toman
VATValue:10%, added on top of the amount
Card-to-card bonusValue:10% extra credit
  • VAT is added on top: the amount you choose is what reaches the wallet, and the VAT is paid in addition to it. The checkout shows the base amount, the VAT and the total before sending you to the gateway.
  • The smallest and largest amounts are the same for every method. For a larger amount, use the contact form.
  • A gateway payment reaches the wallet at once. A card-to-card transfer is confirmed after its receipt is reviewed.
  • Top-ups are made in the dashboard, on the top-up page (in Persian). There is no API to top up.
[05]BILLING AND PRICING

The hold before each call

  • Before a request is sent, its largest possible cost (the prompt plus the output cap) is held from the balance. After the answer, the real cost is charged and the rest of the hold is released at once.
  • When max_tokens asks for more than the balance can fund, the request is not refused: the gateway lowers the output cap to what the balance affords and makes the call. The answer may then end with finish_reason: "length".
  • When you send no output cap and the balance cannot fund the default one, the gateway writes in a cap of up to 4,096 tokens.
  • A 402 with code insufficient_balance is returned only when the balance cannot fund even the prompt plus one output token.
  • /v1/responses is the exception: its output cap is never rewritten.
  • An OpenAI batch (POST /v1/batches) has a hold of its own: the whole file's estimated maximum plus 10%, from the wallet only, until the batch is settled (the batch hold).
[06]BILLING AND PRICING

Failed, cut and partial calls

What is billed
CaseBilled
A successful answerBilled:The usage the vendor reports
An error from the gateway or the vendor (a 4xx or 5xx status)Billed:Nothing; it is only recorded
You close the connection in the middle of a streamBilled:In full: generation runs to its end on the vendor's side
The vendor gives no answer within 10 minutesBilled:Nothing
An answer was partly delivered and then cut on our sideBilled:Only the delivered part, and never more than the amount held
An image or video generation that is cut or failsBilled:Nothing; refunded if it was charged
[07]BILLING AND PRICING

Prompt caching and tools

  • Input tokens read from a cache are billed at the model's cheaper cached rate. That holds for the automatic caching of OpenAI and Gemini, and for Anthropic's cache_control.
  • On Anthropic, writing to the cache has its own rate (one for the five-minute cache, one for the one-hour cache), as the vendor prices it.
  • Web search is billed per search at the model's search rate, in addition to tokens (hosted tools).
[08]BILLING AND PRICING

Chat plans and gift credit

  • The API is pay-as-you-go and needs no plan. With a paid chat plan, API calls are paid from the plan's credit first, up to 40% of the plan's monthly grant, and from the wallet after that. A free account pays for API calls from the wallet only. See the plans (in Persian).
  • A new account spins the gift wheel once: from 100,000 Toman to 1,000,000 Toman of gift credit for the fast, inexpensive models, plus 30,000 Toman for any model. Both are valid for 14 days from the spin and can be spent on API calls.
  • Gift credit is not cash: it cannot be withdrawn or refunded, and it has a fixed expiry.
  • OpenAI Batch is the exception: a batch is paid from the wallet only, and plan credit and gift credit do not pay for it.
[09]BILLING AND PRICING

Refunds and credit expiry

  • Credit you buy yourself has no expiry date.
  • Unused balance can be requested back through the contact form within 30 days of the last top-up. The fee of the gateway you paid with is deducted from the refund.
  • The full text is in the terms of service, and that text is the reference.
[10]BILLING AND PRICING

Reading your own bill

Every call has a row in the usage report with its model, tokens, cached tokens, the USD base price (base_cost_usd) and the Toman amount charged (cost_toman). The same rows are readable with the same key through the account API, a whole date range comes as a CSV file, and the wallet's transactions through GET /v1/wallet/transactions. The non-streamed answer of a billed call also states its amount in the X-1xai-Cost-Toman header (response metadata).

1xAi is an independent gateway. It is not affiliated with, endorsed by, or a reseller for OpenAI, Anthropic, Google, DeepSeek, xAI, Moonshot AI, Z.ai, Alibaba Qwen, MiniMax or Tencent Hunyuan. Requests are relayed upstream rather than answered by models of our own, so each provider's own usage policies apply to what their models will and will not do, and their model availability is theirs to change. Current reachability is published on the status page.