AI APIs
What is the OpenAI API, and how much does it cost?
What the OpenAI API offers, how billing per token works, model prices checked in November 2026, and how to keep costs and keys under control in your app.
The OpenAI API lets software use models for text, code, images, audio and agents. On November 9, 2026, listed flagship text models cost $0.10 to $10 per million input tokens, with higher output prices. Batch processing halves those rates. API billing is separate; eligible Pro and Business plans can claim credits.
Published · Last updated
What the API is
The OpenAI API is the developer interface to OpenAI's models. Instead of chatting in ChatGPT, your code sends requests and receives responses: generating text, extracting data, calling tools, transcribing audio or creating images. You pay for what you use, measured in tokens, roughly pieces of words.
How pricing works
- Input tokens: what you send, including instructions and context.
- Output tokens: what the model generates, priced several times higher than input.
- Batch: asynchronous jobs at half price, for work that can wait up to a day.
- Cached input: repeated prompt prefixes can be billed at a reduced rate.
Current flagship text model prices
OpenAI's pricing page listed these flagship text models on 9 November 2026, per million tokens, standard input then output:
- gpt-6-astra: 10 dollars and 50 dollars.
- gpt-6.1-sol: 2 dollars and 10 dollars.
- gpt-6.1-terra: 1 dollar and 5 dollars.
- gpt-6-luna: 0.10 dollars and 0.50 dollars. Batch prices are half of these. Prices and model names change often, so check the official page before budgeting.
Keeping costs predictable
- Start with the smallest model that does the job, and test larger ones only where quality demands it.
- Limit output length with a maximum token setting.
- Cache or store results that do not need regenerating.
- Set project budgets, and rate limit your own endpoints per user.
- Log token usage per feature, so you know which part of your app costs what.
Keeping keys and users safe
Call the API from your server, never the browser, so the key stays secret. Treat model output as untrusted text: escape it before rendering as HTML, and do not let it run commands or queries without validation.
A public feature that sends user input to a model with no rate limit can be used by anyone, at your expense.
What a scan can and cannot tell you
WebAuditOS checks the parts of an AI-powered site visible from outside: CORS settings on your endpoints, HTML error pages with recognizable debug output, and how many third-party scripts load.
It cannot see your API usage, costs, prompts or whether your keys are exposed in JavaScript bundles.
Watch the usage dashboard for the first days after launch. Unexpected spikes show abuse earlier than any scan.
Short answers
Is the OpenAI API free? No. It is billed per token.
Is the API included in ChatGPT Plus? Plus does not include API credits. Eligible Pro and Business subscriptions can claim API credits after linking an API organization; API usage beyond applicable credits is billed separately.
What is the cheapest OpenAI model? On 9 November 2026, gpt-6-luna was the lowest-priced flagship text model.
How do I estimate cost? Multiply expected input and output tokens per request by the per-million prices.
In the product
The checks this maps to
Every check named here runs on every scan, on every plan - what a plan changes is how many pages are crawled, how long the history is kept and what you can do with the result. These are the ids the findings carry, so you can match a line in a report to the explanation above.
- sec.cors.wildcard - CORS is not wide open
- sec.error-disclosure - Error pages do not leak stack traces
- sec.third-party-scripts - Third-party script count is controlled
Read next
AI APIs
How do you get an OpenAI API key, and keep it safe?
How to create an OpenAI API key, set up billing and project limits, call the API from your server, and protect the key from leaks in browsers and repositories.
AI APIs
How much does the Claude API cost?
Claude API prices per model, checked in November 2026, how batch processing and prompt caching cut costs, and how to keep a Claude feature from overspending.