Home/Blog/Buying an AI API in Iran: Pricing, Rial Payment and Setup Buying an AI API in Iran: Pricing, Rial Payment and Setup 5 Nov 2026·LayerCloud api pricing payment guide Buying an AI API is not the same as buying a ready-made account. With an API key you buy credit, you create the key yourself, and you pay for what you actually consume. That difference decides whether a small project costs you a few dollars a month or a great deal more, and whether anything is left to untangle when you shut the project down. This guide shows what a request really costs, how rial top-ups work, and the four steps between signing up and sending your first request. What you are actually buying There are three ways to reach a model: a key straight from the vendor, a ready-made account or key that someone else controls, and a gateway that puts many models behind key and bill. The first route is usually closed to users in Iran because it needs an international card and a foreign phone number. The second is fast, but the key belongs to someone else: account suspension, a password reset and the loss of your usage history are real risks, and they are what make a cheap account expensive. The third route is what this page describes. You register in your own panel, buy credit, and hold a key that you control. How a request is priced You pay per token, not per request. Every message has two parts: input tokens you send, and output tokens the model generates. Output usually costs several times more than input, so the length of the answer matters more than the length of the question. Model Input (USD per 1M tokens) Output DeepSeek V4 Flash 0.016 0.045 GPT-5.6 Luna 0.05 0.3 Gemini 3.8 Flash 0.19 0.94 Claude Sonnet 5.5 0.5 2.5 Kimi K3 0.75 3.75 GPT-5.5 1.25 7.5 These are gateway rates, not vendor list prices; they sit at roughly a quarter of the official rate for the same models. The full catalogue of more than 140 models, with live prices, is on the pricing page. A worked example: a support bot that sends 500k input tokens and receives 150k output tokens per month costs about $0.63 on Claude Sonnet 5.5 (0.5 × 0.5 + 2.5 × 0.15). The same traffic on GPT-5.5 comes to about $1.75. Resend the full conversation history on every call and the input side multiplies, which widens that gap further. Two more things move the bill: a large context window, because the whole history is sent again each time, and reasoning models, which spend a lot of output tokens even when the visible answer is short. Paying in rial Top-ups are paid in rial through an Iranian gateway. No international card and no workaround is required, the minimum top-up is 300,000 toman, and crypto is available if you would rather not use toman at all. Your balance is held in USD and usage is deducted in USD. The exchange rate therefore does not change the value of credit you already bought, but it does set the price of your next top-up. From signup to your first request Create an account. Email signup or Google and GitHub login; no foreign card. Top up. The balance shows as prepaid credit, with no monthly subscription. Create a key. Issue a separate token per project and give each its own credit limit and model allow-list. This prevents the most common mistake: shared key across three projects, with no way to tell which caused the spike. Send the first request. The OpenAI-compatible endpoint sits at the domain root: curl https://ai.layercloud.org/v1/chat/completions \ -H "Authorization: Bearer $LAYERCLOUD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"anthropic/claude-sonnet-5.5","messages":[{"role":"user","content":"Hello, introduce yourself in sentence"}]}' With the official OpenAI SDK, two values change: from openai import OpenAI client = OpenAI( base_url="https://ai.layercloud.org/v1", api_key="your-key", ) r = client.chat.completions.create( model="google/gemini-3.8-flash", messages=[{"role": "user", "content": "Hello"}], ) print(r.choices[0].message.content) Coding agents such as Claude Code and Cursor work the same way: point their base URL at the gateway and leave the rest of your setup alone. Key hygiene and spend control An API key is a password. Keep it out of frontend code, public repositories and screenshots. Use key per environment, set a credit limit on each, and revoke the old when you rotate. The usage report in the panel shows which model and which key produced the cost, which is usually enough to swap an expensive model for a cheaper where it does not matter. Prepaid accounts or your own key A ready-made account looks cheaper for a experiment, but the key stays with the seller, the usage history and invoice are not yours, and suspension takes everything with it. Your own key is not more expensive, because the gateway sells the same model at pay-as-you-go rates and you pay for what you use. For anything that lives longer than a week, the real difference is ownership rather than price. What not to expect To be clear: rates are in USD, so top-up prices move with the exchange rate. Access to a given model can be interrupted; service status is published on the status page. Content rules from upstream providers apply here too. And token counts can differ from your estimate by a few percent, because every model tokenizes differently. FAQ What is the minimum top-up? 300,000 toman, which is several weeks of a small project. Does it work with the official OpenAI SDK? Yes. Change base_url and api_key; the model names are listed on the pricing page. Can I use it with Claude Code and Cursor? Yes, with any tool that accepts a custom base URL. Configuration details are in the docs. What happens when credit runs out? Requests are rejected, but the account and its keys stay in place. The same key works again after a top-up. Is conversation data stored? The FAQ and the privacy policy cover retention; read that section first if you process sensitive data.