Blog

Open AI API Pricing: Tokens, Images and Credits (2026)

Unicorn API Team · · 10 min read

Diagram of Open AI API pricing showing input tokens, output tokens and images adding up to a credit bill

If you are working out Open AI API pricing for a real project, the rate card is only half the story. The other half is how your application spends tokens: how long your prompts are, how much history you resend, how long the answers run, and whether a reasoning model is thinking out of sight before it replies. This post explains how the billing works, what quietly inflates it, how it compares with Claude and Gemini, and how to estimate and check costs in code before you ship.

How Open AI API pricing works

OpenAI’s developer API is pay as you go. There is no monthly seat fee for the API itself. You pay for what each request uses, and how that is measured depends on the kind of model.

  • Text and chat models are billed per token. A token is a chunk of text, often a short word or a piece of a longer one. Prices are quoted per million tokens.
  • Image models are billed per generated image. The price goes up with quality and size.
  • Audio, embeddings and other specialised models have their own units, such as per minute of audio or per million tokens embedded.

For text models, every request has two meters running. Input tokens cover everything you send: the system prompt, the full conversation history, tool definitions, retrieved documents and the user’s new message. Output tokens cover everything the model writes back. In Open AI API pricing, output tokens are priced several times higher than input tokens on almost every model, so a short question with a long answer can cost more than a long question with a short answer.

One thing trips people up when they read older forum threads. Early GPT-4 prices were quoted per 1,000 tokens, and current price lists use per million. Before you compare two numbers, make sure they use the same unit.

Why output tokens cost more

The model reads your whole input in one parallel pass, but it generates output one token at a time, and each new token needs another trip through the network. Long answers hold expensive GPU time for longer, so providers charge more for them. That is why setting max_tokens and asking for concise answers are the two cheapest optimisations you have.

Why is API pricing so high?

It often feels high because the costs are hidden in volume. A single request is cheap. A chatbot that resends a growing conversation on every turn, for thousands of users, is not. Flagship models need the most hardware per token, so they sit at the top of every price list. The smaller tiers in the same family usually cost much less and handle most classification, extraction, routing and short-reply work well. Choosing the right tier for each task usually saves more than any discount does.

What else shows up on the bill

The headline per-token rates are the start. These line items explain most of the surprises people see on their first invoice.

Reasoning tokens

Reasoning models think before they answer. That internal work is billed as output tokens, even though you never see most of it. A one-line answer can carry hundreds or thousands of reasoning tokens behind it. If your bill seems out of proportion to the visible responses, this is usually why. Where a model supports it, lower reasoning_effort for simple tasks.

Cached input

When many requests start with the same long prefix, such as a system prompt or a reference document, OpenAI and several other providers charge a reduced rate for the repeated part. To benefit, keep the static content at the start of the prompt and put the parts that change at the end.

Batch processing

If results can wait, batch endpoints process requests asynchronously at a discount. This suits overnight jobs like tagging a catalogue or summarising documents. It does not suit anything a user is waiting on.

Images

Image generation is priced per output, and the quality setting matters a lot. On Unicorn API, GPT Image 1.5 costs 3 credits per image at low quality, 4 at medium and 15 at high. High costs five times as much as low, so leaving quality on high for drafts is an expensive habit. Asking for several images with n multiplies the price by that number.

Tools and extras

Some built-in tools, such as hosted search or file retrieval, carry their own fees on top of tokens. Tool definitions also count as input tokens on every request that includes them, so a large tool list costs you on every call.

Stacked bar breaking one API request into input, cached, reasoning and output token costs
One request, many line items: history and reasoning tokens are where bills quietly grow.

Is there a free tier for the OpenAI API?

This is the most common question about Open AI API pricing, and the answer is: not in any form you should build a budget around. The ChatGPT app has a free plan, but that is a consumer product with separate billing. The API is prepaid or pay as you go. Promotional trial credits have come and gone, and you should not count on them.

What OpenAI does have is usage tiers. As your account’s spend history grows, your rate limits go up: more requests and tokens per minute. Those tiers control throughput, not the price per token.

Other providers handle this differently. Google AI Studio has offered a free usage tier with low rate limits for Gemini models, which is useful for prototyping. That is the main reason people search for Google AI Studio API pricing. Anthropic’s Claude API, like OpenAI’s, is mainly paid per token.

If what you really want is a low-commitment way to try models, prepaid credits that never expire do the job. On Unicorn API, top-up credits cost $0.015 each and never expire. Monthly plans give credits at $0.01 each: Starter is $25, Creator $50, Studio $100 and Pro $200 per month. You can also try image models in the browser at the playground before writing any code.

AI API pricing comparison: OpenAI, Claude, Gemini and others

Exact rates change often, so the table below compares pricing structures rather than numbers. Structure is what decides whether a provider will be cheap for your workload. Once you understand Open AI API pricing, the others are easy to read, because most text providers use the same input and output model.

ProviderBilling unitCost levers worth knowing
OpenAI (GPT models)Per million input and output tokens; per image for image modelsCached input, batch discount, reasoning tokens billed as output, image quality tiers
Anthropic (Claude)Per million input and output tokensPrompt caching, batch processing, separate rates per model tier
Google (Gemini, AI Studio)Per million input and output tokensFree tier with low limits, context-length pricing on some models, caching
Moonshot AI, Z.aiPer million input and output tokensOften positioned as lower-cost alternatives; check context limits
Kling and other video modelsPer generated clipDuration, resolution and mode drive the price

So when people search for Claude AI API pricing or Google AI API pricing, they are really asking the same three questions. What does input cost? What does output cost? Which discounts fit my traffic? The bigger practical problem is that each provider needs its own account, key, billing setup and SDK quirks.

That is the problem Unicorn API solves. One key and one credit balance cover chat, image, video and audio models from several providers. For example, Google’s Gemini 4 Argon costs 320 credits per million input tokens and 1,600 credits per million output tokens. It is also available under the id gemini-4-argon-openai at the same price. OpenAI’s GPT Image 1.5 sits on the same balance. For OpenAI’s text models, see our posts on GPT 5.6 Sol, GPT 5.6 Luna and GPT 6. The full list is in the model catalog.

What media models cost on the same balance

ModelTypePrice in creditsOn a monthly plan ($0.01/credit)
GPT Image 1.5Image (OpenAI)3 low / 4 medium / 15 high per image$0.03 / $0.04 / $0.15
Nano Banana 2 LiteImage (Google)4 per image$0.04
Grok Imagine Video 1.5Image-to-video, 1-15 s3 / 4 / 7 per second at 480p / 720p / 1080p$0.20 for 5 s at 720p
Grok Imagine Video 1.0Text or image to video, 6-30 sSame per-second rate as 1.5$0.24 for 6 s at 720p
Vidu Q4 Image To VideoImage-to-video7.2 / 15.2 / 19.2 / 30.4 / 62.4 per second at 540p / 720p / 1080p / 2k / 4k$0.76 for 5 s at 720p
Vidu Q4 Reference To VideoReference-to-videoSame per-second rates as Q4 Image To Video$0.76 for 5 s at 720p

If you are comparing Kling AI API pricing in particular, our Kling 2.6 post covers its per-clip costs.

A worked example: estimating a monthly bill

A rate card is useless until you multiply it by your traffic. Here is the method, using made-up but realistic usage and the Gemini 4 Argon prices above. The arithmetic is the same for any per-token model, so you can apply it to Open AI API pricing by swapping in OpenAI’s rates.

Say you run a support assistant. Each request sends about 2,000 input tokens (system prompt, recent history and the question) and gets back about 500 output tokens. You expect 10,000 requests a month.

  1. Input: 2,000 × 10,000 = 20 million tokens. At 320 credits per million, that is 6,400 credits.
  2. Output: 500 × 10,000 = 5 million tokens. At 1,600 credits per million, that is 8,000 credits.
  3. Total: 14,400 credits. On a monthly plan at $0.01 per credit that is $144. With top-up credits at $0.015, it is $216.

Two things stand out. First, output is a quarter of the token count but more than half the cost. Second, the input side is mostly history. Halve the history you resend and you cut that 6,400 credits roughly in half.

Now add product images. Suppose the same team generates 500 images a month with GPT Image 1.5. At medium quality that is 2,000 credits ($20 on a plan). At high quality it is 7,500 credits ($75). Use medium for drafts and high only for the final picks.

Finally, leave a margin for retries, longer conversations than you planned for, and reasoning tokens if you use a reasoning model. Real-world Open AI API pricing estimates go wrong most often because they assume every request looks like the average one.

Calculator panel estimating monthly API cost from requests, input tokens, output tokens and images
Estimate both sides of every request, then multiply by volume.

Calling the models and tracking cost in code

Unicorn API’s chat endpoint is OpenAI-compatible, so code written for OpenAI’s chat completions works with a different base URL. Create a key at /keys and export it as UNICORN_API_KEY.

Chat completion with curl

curl https://api.unicornapi.net/v1/chat/completions \
  -H "Authorization: Bearer $UNICORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-4-argon",
    "messages": [
      {"role": "system", "content": "You are a concise support assistant."},
      {"role": "user", "content": "How do I reset my password?"}
    ],
    "max_tokens": 200
  }'

The response includes a usage object with the input and output token counts the model reported. The cost is debited from those counts.

Python: log the credit cost of every chat call

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.unicornapi.net/v1",
    api_key=os.environ["UNICORN_API_KEY"],
)

# Gemini 4 Argon rates in credits per 1M tokens
INPUT_RATE = 320
OUTPUT_RATE = 1600

resp = client.chat.completions.create(
    model="gemini-4-argon",
    messages=[{"role": "user", "content": "Summarise our refund policy in two sentences."}],
    max_tokens=200,
)

usage = resp.usage
credits = (usage.prompt_tokens * INPUT_RATE + usage.completion_tokens * OUTPUT_RATE) / 1_000_000
print(resp.choices[0].message.content)
print(f"{usage.prompt_tokens} in, {usage.completion_tokens} out, about {credits:.3f} credits")

Log that number for every request in staging. A day of real traffic gives you a far better estimate than any spreadsheet.

Python: generate an image with GPT Image 1.5

Media models run as jobs. You create a job, then poll it until it finishes.

import os
import time
import requests

BASE = "https://api.unicornapi.net"
HEADERS = {"Authorization": f"Bearer {os.environ['UNICORN_API_KEY']}"}

job = requests.post(
    f"{BASE}/v1/jobs",
    headers=HEADERS,
    json={
        "model": "gpt-image-1.5",
        "input": {
            "prompt": "A ceramic coffee mug on a walnut desk, soft morning light, product photo",
            "quality": "medium",
            "aspect_ratio": "1:1",
        },
    },
).json()

while job["status"] not in ("succeeded", "failed"):
    time.sleep(2)
    job = requests.get(f"{BASE}/v1/jobs/{job['id']}", headers=HEADERS).json()

if job["status"] == "succeeded":
    print(job["outputs"][0]["url"])
else:
    print("Job failed:", job)

At medium quality this request costs 4 credits. To see the exact price of any request before you run it, call POST /v1/models/price. The request format is in the API documentation. If you work inside Cursor or Claude Code, the MCP setup lets your agent call the same models directly.

Common mistakes that inflate API bills

Most overspending comes from a few habits. They apply to Open AI API pricing and to every other per-token provider.

  • Resending the whole conversation forever. Every turn re-bills all the earlier turns as input. Trim history, or summarise older turns into a short note.
  • No max_tokens limit. One rambling answer is cheap. Ten thousand of them are not. Set a ceiling that fits the task.
  • Using the flagship model for everything. Send classification, routing and extraction to a smaller model and keep the flagship for hard reasoning.
  • Ignoring reasoning tokens. Reasoning models bill their thinking as output. Lower reasoning_effort where the task is simple.
  • Putting variable content first. Caching only helps when the repeated prefix comes first. Put the system prompt and static documents at the top.
  • Drafting images at high quality. With GPT Image 1.5, high costs 15 credits against 4 for medium. Iterate at low or medium.
  • Unbounded retries. A retry loop with no cap during an outage can double a day’s spend. Use backoff and a maximum attempt count.
  • Comparing per-1K and per-1M prices. Older posts use per-1,000-token units. Convert before you compare.

Fix these and Open AI API pricing becomes predictable: you know what each request costs, you know your volume, and the bill is simple multiplication. To try it on one balance across chat, image and video models, see the plans and credit prices.

Frequently asked questions

Is there a free tier for the OpenAI API?

Not one you should plan around. The free ChatGPT plan is a consumer product and is separate from the API. The API is pay as you go and billed per token or per image, and any trial credits have been occasional promotions. If you need to test for free, look for a playground or a provider with a free usage tier. Otherwise, start with a small prepaid balance and a spend limit.

Why is API pricing so high?

Every request runs on expensive GPUs. Output is generated one token at a time, so long answers tie up hardware for longer, and long inputs take memory and compute to process. Flagship models need the most hardware, so they cost the most. Smaller models in the same family are often far cheaper, and they handle most classification, extraction and short-reply work well.

How much does GPT AI cost?

It depends on the model and on how you use it. Text models bill per million input tokens and per million output tokens, with output priced higher. Image models bill per image by quality. On Unicorn API, GPT Image 1.5 costs 3 credits per image at low quality, 4 at medium and 15 at high. On a monthly plan a credit is $0.01, so that is $0.03 to $0.15 per image.

Is chat API free?

Usually not. Chat apps like ChatGPT have free plans, but the developer APIs behind them charge for every token you send and receive. Some providers offer limited free tiers with low rate limits for prototyping. For production use, expect to pay per request and budget for both input and output tokens, plus reasoning tokens if you use a reasoning model.

How can I estimate an API bill before running requests?

Measure your typical input and output tokens per request, multiply each by its per-million rate, then multiply by your monthly request volume. Add a margin for retries and reasoning tokens. On Unicorn API you can also call POST /v1/models/price to get the exact credit cost of a request before you run it, and chat responses report the token usage that was billed.