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,238+46 in the last 30 days
npm downloads a week
51Mup 10% on the week before
Latest release
v7.45.116 hours 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.

020M40M60MSepNovJanMarMayJulOct24 September 2025: 6,554,806 downloads a week1 October 2025: 6,874,350 downloads a week8 October 2025: 6,778,636 downloads a week15 October 2025: 7,436,647 downloads a week22 October 2025: 7,560,857 downloads a week29 October 2025: 7,390,745 downloads a week5 November 2025: 7,445,765 downloads a week12 November 2025: 7,593,040 downloads a week19 November 2025: 7,960,744 downloads a week26 November 2025: 8,049,659 downloads a week3 December 2025: 7,597,024 downloads a week10 December 2025: 8,957,669 downloads a week17 December 2025: 8,650,955 downloads a week24 December 2025: 7,000,301 downloads a week31 December 2025: 4,827,803 downloads a week7 January 2026: 7,027,512 downloads a week14 January 2026: 9,428,422 downloads a week21 January 2026: 9,505,965 downloads a week28 January 2026: 11,372,924 downloads a week4 February 2026: 12,066,073 downloads a week11 February 2026: 12,498,508 downloads a week18 February 2026: 11,678,701 downloads a week25 February 2026: 13,102,575 downloads a week4 March 2026: 14,106,298 downloads a week11 March 2026: 16,452,816 downloads a week18 March 2026: 16,761,610 downloads a week25 March 2026: 16,121,832 downloads a week1 April 2026: 16,417,035 downloads a week8 April 2026: 15,330,157 downloads a week15 April 2026: 18,321,478 downloads a week22 April 2026: 18,464,061 downloads a week29 April 2026: 20,323,370 downloads a week6 May 2026: 20,467,023 downloads a week13 May 2026: 21,443,540 downloads a week20 May 2026: 21,826,188 downloads a week27 May 2026: 22,620,668 downloads a week3 June 2026: 24,359,714 downloads a week10 June 2026: 25,200,786 downloads a week17 June 2026: 26,288,763 downloads a week24 June 2026: 27,559,108 downloads a week1 July 2026: 25,312,664 downloads a week8 July 2026: 27,272,595 downloads a week22 July 2026: 29,736,097 downloads a week29 July 2026: 31,424,108 downloads a week5 August 2026: 33,382,428 downloads a week12 August 2026: 32,390,337 downloads a week26 August 2026: 37,214,622 downloads a week2 September 2026: 40,607,871 downloads a week28 September 2026: 46,159,593 downloads a week5 October 2026: 50,776,253 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