OpenAI API
The OpenAI API gives developers pay-per-token access to OpenAI's GPT model family for building AI features into their own products, separate from the consumer ChatGPT apps. As of September 2026 the current flagship family is GPT-6, offered in tiers such as Astra, Sol and Luna at different price and speed points, alongside continued access to the earlier GPT-5.6 line. There's no free tier; usage is billed per million tokens and varies by model.
Facts checked on against the sources listed at the end of this page.
- Pricing
- Pay as you goPaid from $0.10 input / $0.50 output per million tokens on GPT-6 Luna
- Open source
- NoProprietary
- GitHub stars
- 11,206
- npm downloads a week
- 51Mup 13% on the week before
- Latest release
- v7.30.01 day ago
- Releases in 90 days
- 10about 3 a month
A good fit for
- Adding GPT-based text, reasoning or coding capability to your own application
- Workloads that can batch requests to cut costs roughly in half
- Applications that repeat the same context across many calls, benefiting from cached input pricing
- Teams already on Microsoft Azure who want to bill OpenAI usage through that account
Not a good fit for
- Prototyping without any budget, since there's no free API tier
- Teams that need to run the model on their own hardware, since GPT-6 is not released as open weights
- Applications needing perfectly predictable costs, since spend scales directly with tokens used
OpenAI API pricing
There's no free tier. Pricing is per million tokens and depends on the model: GPT-6 Luna starts around $0.10 input / $0.50 output, GPT-6 Sol is $2.00 input / $10.00 output, and GPT-6 Astra is $10.00 input / $50.00 output for short-context calls, with long-context variants priced higher. Batch processing is about half price, and cached input tokens are discounted around 90%.
| Plan | Price | What you get |
|---|---|---|
| GPT-6 Luna | $0.10 input / $0.50 output per million tokens | Fastest, lowest-cost model tier for short-context calls. |
| GPT-6 Sol | $2.00 input / $10.00 output per million tokens | Balanced speed and quality for short-context calls. |
| GPT-6 Astra | $10.00 input / $50.00 output per million tokens | Top reasoning tier for short-context calls. |
| gpt-5.3-codex | $1.75 input / $14.00 output per million tokens | Specialized coding model. |
| Batch processing | About 50% off standard model rates | For requests that don't need an immediate response. |
Prices in USD, checked on 27 September 2026. Current prices on developers.openai.com.
Main features
- GPT-6 model tiers
- Astra, Sol and Luna model tiers at different price and capability points, plus long-context variants.
- Function and tool calling
- Models can call developer-defined functions or tools as part of a response.
- Structured outputs
- Constrain responses to a defined JSON schema.
- Codex models
- Specialized coding models such as gpt-5.3-codex, priced separately from general chat models.
- Batch API
- Submit non-time-sensitive requests at roughly half the standard per-token price.
- Cached input pricing
- Repeated input tokens across calls are billed at about 90% less than standard input rates.
- Azure OpenAI Service
- The same models are available through Microsoft Azure, billed through an Azure account.
About OpenAI API
The OpenAI API provides direct, pay-per-token access to OpenAI's models for developers building AI into their own applications, separate from the ChatGPT consumer apps. It supports text generation, structured outputs, function/tool calling, image understanding, and specialized endpoints for coding (gpt-5.3-codex) and other tasks.
As of September 2026 the current flagship family is GPT-6, split into tiers at different price and speed points, for example Astra for demanding reasoning, Sol for balanced use, and Luna for speed and low cost, with long-context variants priced higher than short-context calls. The earlier GPT-5.6 line remains available for existing integrations.
Pricing includes cost-reduction options: batch processing cuts standard rates roughly in half for non-time-sensitive workloads, and cached input tokens (repeated context across calls) are discounted about 90% from standard input pricing.
- Made by
- OpenAI
- Free plan
- No, the API has no free tier and is billed per token from the first request
- Available on
- REST API, Official SDKs (Python, Node.js and others), Microsoft Azure OpenAI Service
Usage and activity
Weekly npm downloads of openai, last 12 months.
Recent releases
OpenAI API alternatives
OpenAI API compared
OpenAI APIvsAnthropic Claude
Anthropic Claude is accessed through four model tiers, Fable 5.1, Opus 5.5, Sonnet 5 and Haiku 4.5, three of which support up to 1 million tokens of context.
OpenAI APIvsCohere
Cohere is an enterprise-focused AI company offering its Command language models plus embedding and rerank models for search and retrieval, available through its own API and major clouds.
Questions about OpenAI API
Does the OpenAI API have a free tier?
No, there's no free tier. Every request is billed per token from the start, though new accounts sometimes receive promotional credit.
What's the current OpenAI model lineup?
As of September 2026 the flagship family is GPT-6, in tiers such as Astra, Sol and Luna, alongside continued access to the earlier GPT-5.6 line and specialized models like gpt-5.3-codex.
How can I reduce OpenAI API costs?
Use the Batch API for non-time-sensitive requests, which costs roughly half the standard rate, and structure prompts to reuse cached context, which is discounted about 90% from standard input pricing.
Can I use the OpenAI API through Azure?
Yes, the same models are available through the Azure OpenAI Service, billed through your Azure account.
Sources and links
Work on OpenAI API? Claim this listing. Something wrong or out of date? Suggest a correction. Stats come from the public GitHub and npm APIs and update every day.
