How it works
You send messages (plus optional images, files or tool definitions) and get a reply, streamed token by token if you like. The line-up runs from small, low-cost models for simple high-volume work to flagship reasoning models for hard problems, alongside models for image generation, speech-to-text, text-to-speech, realtime voice and embeddings. The Responses API is the main interface today; the older Chat Completions format is so widely copied that many other providers accept it too.
There is no free tier: you prepay credit and can set budgets per project. Batch jobs that can wait up to a day cost half as much, and repeated prompt prefixes are billed at a discount when cached. API data is not used to train models by default. The same models are also sold through Microsoft Azure and Amazon Bedrock, for companies that prefer to buy through their existing cloud.
OpenAI API pros and cons
Pros
- Wide range of models, from cheap and fast to flagship reasoning
- Mature SDKs, documentation and examples in most languages
- Its request format is supported by many other providers and tools
- Built-in tools such as web search, file search and code execution
Cons
- Pay per token from the first request, with no free tier
- Models are retired on a schedule, so apps need occasional upgrades
- Self-serve fine-tuning closed to new customers in 2026
When to use OpenAI API
Pick it when
- You want a well-documented default with broad model choice
- One vendor should cover text, vision, speech and embeddings
- Your company already buys through Azure or AWS and wants the same models there
Skip it when
- Data must never leave your own servers (run an open model instead)
- You need a free tier for a prototype (Gemini has one)
OpenAI API pricing
Pay as you go
Per million tokens: from about $0.10 input and $0.50 output for small models to about $10 input and $50 output for the flagship. Batch jobs are half price.
OpenAI API pricing page (opens in a new tab)Approximate, checked September 2026.What the other tools cost
OpenAI API vs the alternatives
- OpenAI vs Gemini vs Claude vs OpenRouterThree model makers and one gateway in front of them all. Prices are rough ranges per million input tokens; output tokens cost about four to six times more.
- Cloud API vs gateway vs running it yourselfThree ways to get a model's answers into an app: sign up with one provider, go through a gateway to many, or run an open model on hardware you control.
Related terms
More in AI and LLMs
Model providers