Skip to content

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.

By OpenAIPay as you goSince 2020AI Platforms & APIs

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%.

PlanPriceWhat you get
GPT-6 Luna$0.10 input / $0.50 output per million tokensFastest, lowest-cost model tier for short-context calls.
GPT-6 Sol$2.00 input / $10.00 output per million tokensBalanced speed and quality for short-context calls.
GPT-6 Astra$10.00 input / $50.00 output per million tokensTop reasoning tier for short-context calls.
gpt-5.3-codex$1.75 input / $14.00 output per million tokensSpecialized coding model.
Batch processingAbout 50% off standard model ratesFor 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.

020M40M60MOctDecJanMarMayJulOct7 October 2025: 6,761,891 downloads a week14 October 2025: 7,351,182 downloads a week21 October 2025: 7,535,734 downloads a week28 October 2025: 7,456,848 downloads a week4 November 2025: 7,362,998 downloads a week11 November 2025: 7,602,690 downloads a week18 November 2025: 7,835,363 downloads a week25 November 2025: 8,169,526 downloads a week2 December 2025: 7,436,760 downloads a week9 December 2025: 8,913,375 downloads a week16 December 2025: 8,682,204 downloads a week23 December 2025: 7,738,180 downloads a week30 December 2025: 4,844,972 downloads a week6 January 2026: 6,293,314 downloads a week13 January 2026: 9,257,827 downloads a week20 January 2026: 9,406,466 downloads a week27 January 2026: 11,120,676 downloads a week3 February 2026: 12,026,852 downloads a week10 February 2026: 12,369,203 downloads a week17 February 2026: 11,798,918 downloads a week24 February 2026: 12,789,899 downloads a week3 March 2026: 13,987,751 downloads a week10 March 2026: 16,105,401 downloads a week17 March 2026: 16,702,441 downloads a week24 March 2026: 16,227,948 downloads a week31 March 2026: 16,449,649 downloads a week7 April 2026: 15,183,051 downloads a week14 April 2026: 18,107,622 downloads a week21 April 2026: 18,174,774 downloads a week28 April 2026: 20,067,915 downloads a week5 May 2026: 20,585,685 downloads a week12 May 2026: 21,248,547 downloads a week19 May 2026: 21,729,026 downloads a week26 May 2026: 22,135,877 downloads a week2 June 2026: 24,753,917 downloads a week9 June 2026: 24,885,343 downloads a week16 June 2026: 26,140,449 downloads a week23 June 2026: 27,592,306 downloads a week7 July 2026: 26,469,595 downloads a week21 July 2026: 29,425,745 downloads a week28 July 2026: 31,288,022 downloads a week4 August 2026: 33,208,597 downloads a week11 August 2026: 32,187,507 downloads a week25 August 2026: 36,526,755 downloads a week1 September 2026: 39,869,756 downloads a week27 September 2026: 44,923,488 downloads a week4 October 2026: 50,858,207 downloads a week

Recent releases

OpenAI API alternatives

All 11 alternatives to OpenAI API, side by side

OpenAI API compared

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.

OpenAI API: pricing, features and alternatives (2026) | ScratchDB