Skip to main content

OpenAI API

Featured

OpenAI's developer API for GPT-6 text, image, speech and embedding models

Code / DevToolsFreemium

Programmatic access to OpenAI's models: the GPT-6 family for text and vision, plus image, realtime voice, transcription and embedding models. Per-token pricing runs from $0.10 per million input tokens (GPT-6 Luna) to $10 (GPT-6 Astra).

Key specs
2,000,000 Developers using OpenAI API source
as of 2026-09-11

What we know

Modelsgpt-6-astra, gpt-6-1-sol, gpt-6-1-terra, gpt-6-lunafrom our original listing, not yet re-checked
PricingFreemiumfrom our original listing, not yet re-checked

Why it matters

  • Industry standard API format adopted by 30+ other providers (Groq, Together AI, Fireworks, Cerebras) — code written for OpenAI works with most competitors with minimal changes.
  • Broadest capability surface — text, vision, images, audio, and code interpreter in one API account; no need for multiple providers.
  • Massive ecosystem of libraries, tutorials, and community resources — virtually every AI integration guide starts with OpenAI examples.
  • Assistants API provides managed state for user-facing AI assistants — eliminates conversation history management and RAG pipeline code.

Key capabilities

  • Text and vision: GPT-6 Astra, GPT-6.1 Sol, GPT-6.1 Terra and GPT-6 Luna through the Responses API and Chat Completions.
  • Function calling: Tool use with parallel calls for agent workflows.
  • Structured outputs: Force model to output valid JSON matching a schema.
  • Image generation: Text-to-image via current OpenAI image models.
  • Whisper: Speech-to-text in 99 languages; timestamped transcription.
  • TTS: Voice options; MP3/Opus/AAC output.
  • Embeddings: text-embedding-3-small/large for RAG and semantic search.
  • Assistants / Responses APIs: Persistent threads, file search, code interpreter.
  • Batch API: Async batch processing at discount rates.
  • Fine-tuning: Fine-tune supported chat models on custom datasets (check platform catalog).

Technical notes

  • Models: GPT-6 family for new apps; see the model list.
  • Python: pip install openai
  • TypeScript: npm install openai
  • API base: api.openai.com/v1
  • Pricing: per token, from $0.10 (GPT-6 Luna) to $10 (GPT-6 Astra) per million input tokens.
  • Rate limits: Vary by usage tier; see platform.openai.com

Usage example

from openai import OpenAI

client = OpenAI(api_key="YOUR_OPENAI_API_KEY")

# Streaming chat completion
with client.chat.completions.stream(
    model="gpt-5.6",
    messages=[{"role": "user", "content": "Explain quantum computing in simple terms"}]
) as stream:
    for text in stream.text_stream:
        print(text, end="", flush=True)

# Structured output
from pydantic import BaseModel

class Person(BaseModel):
    name: str
    age: int
    occupation: str

response = client.beta.chat.completions.parse(
    model="gpt-6.1-sol",
    messages=[{"role": "user", "content": "Extract: John is a 30-year-old engineer"}],
    response_format=Person,
)
person = response.choices[0].message.parsed

Ideal for

  • New AI projects that want the most documented, community-supported API with the broadest feature surface.
  • Applications requiring multiple modalities (text + images + audio) without managing multiple APIs.
  • Teams building user-facing AI assistants who want managed conversation state via the Assistants API.

Not ideal for

  • Cost-sensitive applications at scale — Llama via Groq/Together AI is 10x+ cheaper for comparable open-model quality.
  • Fully offline/on-premise — OpenAI is cloud-only (Azure OpenAI offers managed cloud alternative).

See also

  • Anthropic API — Claude API; 1M-token context, computer use, strong instruction following.
  • Vercel AI SDK — TypeScript SDK with native OpenAI support for web apps.
  • Groq — very fast inference for open models, for latency-sensitive apps.
  • Best AI coding tools guide — Using the OpenAI API to build coding assistants and dev tools.
  • Best AI chatbots guide — Building chatbots and conversational products on the OpenAI API.

Sources

FAQ

What is the OpenAI API?

The OpenAI API gives developers access to OpenAI's models from their own code. For new apps, OpenAI recommends GPT-6 Astra for complex work, GPT-6.1 Sol to balance cost, and GPT-6 Luna for high volume. It also offers image, speech, transcription and embedding models.

How is the OpenAI API priced?

Pricing is per token and varies by model. Per million tokens: GPT-6 Astra $10 input / $50 output, GPT-6.1 Sol $2 / $10, GPT-6.1 Terra $1 / $5, GPT-6 Luna $0.10 / $0.50. The Batch API discounts work that can wait.

What is the OpenAI Assistants API?

The Assistants API creates persistent AI assistants with managed conversation threads, file search (RAG over uploaded files), Code Interpreter (runs Python code in a sandbox), and custom tool definitions. Unlike the Chat Completions API (stateless), Assistants maintains state across interactions without you managing conversation history. Useful for building AI-powered user interfaces where each user has a persistent assistant.

What is function calling in the OpenAI API?

Function calling (tool use) lets you define functions the model can call with structured parameters. You describe available functions in the API call; when the model decides to use one, it returns a structured JSON object with the function name and arguments. Your code executes the function and returns the result. This enables building agents that call APIs, query databases, and take real-world actions based on user requests.

Alternatives

Is your tool an alternative to OpenAI API? Sponsor this spot for 30 days, marked Sponsored.

Integrations

None listed.

Powered by

Built on

Good for these tasks

For the team behind OpenAI API

Growth plan: from $399 a month

SEO, AI search (how ChatGPT, Perplexity and Google describe OpenAI API), UX, CRO and support from one account manager, with a monthly report. Includes a Featured launch on db.fyi. Starts with a free audit.

Founding offer: $299 a month for your first 3 months, plus a free case study.

Get a free audit

Listed 2026-02-22 · updated 2026-11-12