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,268+43 in the last 30 days
npm downloads a week
59Mup 3% on the week before
Latest release
v7.57.03 days 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

GitHub stars, last 12 months. Updated 17 November 2026.

11.2k11.2k11.2k11.2k11.3k11.3kSepOctOctOctOctNovNovNov29 September 2026: 11,191 stars6 October 2026: 11,202 stars13 October 2026: 11,217 stars20 October 2026: 11,228 stars27 October 2026: 11,240 stars3 November 2026: 11,246 stars10 November 2026: 11,258 stars17 November 2026: 11,268 stars

Weekly npm downloads of openai, last 12 months.

020M40M60MOctDecFebAprJunAugNov19 October 2025: 7,472,664 downloads a week26 October 2025: 7,411,064 downloads a week2 November 2025: 7,317,250 downloads a week9 November 2025: 7,694,301 downloads a week16 November 2025: 7,675,862 downloads a week23 November 2025: 8,092,047 downloads a week30 November 2025: 7,273,518 downloads a week7 December 2025: 8,772,746 downloads a week14 December 2025: 8,725,167 downloads a week21 December 2025: 8,518,153 downloads a week28 December 2025: 5,259,119 downloads a week4 January 2026: 5,254,706 downloads a week11 January 2026: 8,847,130 downloads a week18 January 2026: 9,553,386 downloads a week25 January 2026: 10,351,429 downloads a week1 February 2026: 11,908,740 downloads a week8 February 2026: 12,222,354 downloads a week15 February 2026: 12,369,859 downloads a week22 February 2026: 11,882,610 downloads a week1 March 2026: 13,812,916 downloads a week8 March 2026: 14,932,361 downloads a week15 March 2026: 16,815,026 downloads a week22 March 2026: 16,446,829 downloads a week29 March 2026: 16,362,419 downloads a week5 April 2026: 15,693,733 downloads a week12 April 2026: 17,121,279 downloads a week19 April 2026: 17,936,570 downloads a week26 April 2026: 19,316,762 downloads a week3 May 2026: 21,090,940 downloads a week10 May 2026: 20,513,252 downloads a week17 May 2026: 21,570,742 downloads a week24 May 2026: 22,530,663 downloads a week31 May 2026: 23,950,273 downloads a week7 June 2026: 24,458,883 downloads a week14 June 2026: 25,811,014 downloads a week21 June 2026: 27,415,266 downloads a week28 June 2026: 26,088,603 downloads a week5 July 2026: 25,353,504 downloads a week12 July 2026: 28,932,596 downloads a week19 July 2026: 29,533,977 downloads a week26 July 2026: 30,643,878 downloads a week2 August 2026: 32,728,731 downloads a week9 August 2026: 31,996,762 downloads a week16 August 2026: 34,605,869 downloads a week23 August 2026: 34,510,842 downloads a week30 August 2026: 39,740,141 downloads a week6 September 2026: 42,162,256 downloads a week28 September 2026: 46,159,593 downloads a week5 October 2026: 50,776,253 downloads a week1 November 2026: 55,441,063 downloads a week8 November 2026: 57,338,964 downloads a week15 November 2026: 58,843,658 downloads a week

Recent releases

OpenAI API alternatives

All 14 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