NativeAIHub
OpenAI API logo

OpenAI API

api

by openai

The developer platform for accessing GPT-5.5, GPT-5.4, GPT-5, GPT-4.1, image generation, real time voice, embeddings, and more. Pay per token with no subscriptions required.

Key features

Chat Completions and Responses API
Function Calling and Tool Use
Structured Outputs
Reasoning (Built into GPT-5.5 and GPT-5.4)
Assistants API (Legacy)
Image Generation (GPT Image)
Pricing

From $undefined/undefined

Best For

Developers building AI powered applications who need programmatic access to frontier models with full control over prompts, parameters, and integration logic

Verdict

The broadest model lineup of any AI provider: text, reasoning, image generation, real time voice, embeddings, speech to text, and moderation all under one platform

What it does

Chat Completions and Responses API

Send messages to any OpenAI model and receive generated text responses. The Responses API is the newest interface, combining the simplicity of Chat Completions with built in tool use capabilities.

Learn more

Function Calling and Tool Use

Models can call functions you define, enabling them to interact with external systems, databases, and APIs. Supports parallel function calls and structured JSON output for reliable integrations.

Learn more

Structured Outputs

Guarantee that model responses conform to a JSON Schema you provide. Eliminates parsing failures and ensures deterministic output structure for production applications.

Reasoning (Built into GPT-5.5 and GPT-5.4)

All GPT-5.5 and GPT-5.4 models support adjustable reasoning effort (none, low, medium, high, xhigh) built in, replacing the need for separate reasoning model families. Designed for complex math, science, multi step problems, and agentic workflows where deeper thinking produces better results.

Learn more

Assistants API (Legacy)

Build assistant like experiences with persistent threads, file storage, code interpreter, file search (vector store based RAG), and function calling, all managed server side by OpenAI. Now a legacy API; OpenAI recommends migrating to the Responses API for new projects.

Image Generation (GPT Image)

Generate and edit images via API using GPT Image 2, GPT Image 1.5, and GPT Image 1 Mini. Supports text prompts, image editing, and variations. Excellent text rendering in generated images.

Realtime API

Low latency, multimodal API for speech to speech, text to speech, and real time conversational experiences. Supports both text and audio input/output with sub second latency.

Fine Tuning (Winding Down)

OpenAI is winding down the self serve fine tuning platform. It is no longer accessible to new users. Existing users can still create training jobs for the coming months, and all fine tuned models remain available for inference until their base models are deprecated.

Learn more

Batch API

Process large volumes of requests asynchronously within 24 hours at 50% off standard pricing. Ideal for data processing, content generation, and non time sensitive workloads.

Learn more

Embeddings

Convert text into numerical vectors for semantic search, clustering, classification, and recommendation systems. Available in small (1536 dimensions) and large (3072 dimensions) variants.

Web Search Tool

Built in tool that enables models to search the web for up to date information during API calls. Billed per tool call plus search content tokens.

Tool Search

Built in tool that lets models discover and select from available tools dynamically during a conversation. Useful for agentic workflows where the set of available tools is large or changes over time.

Computer Use

Enables models to interact with desktop environments by taking screenshots and performing mouse and keyboard actions. Achieved 75% on the OSWorld benchmark, making it viable for automating GUI based workflows and testing.

Priority Processing

A pricing tier that provides 2x faster processing at 2x the standard token cost. Designed for latency sensitive, user facing applications where speed matters more than cost efficiency.

Whisper (Speech to Text)

Transcribe and translate audio in 50+ languages. Available both via API and as an open source model you can self host.

Pricing

ModelInput / 1M tokensOutput / 1M tokens
GPT-5.5Latest flagship. Best for complex reasoning and coding. 1M context. Cached input: $0.50/1M$5.00$30.00
GPT-5.5 ProPremium flagship with maximum quality. 1M context. For the hardest problems$30.00$180.00
GPT-5.4Affordable flagship for coding and professional work. 1M context. Cached input: $0.25/1M$2.50$15.00
GPT-5.4 ProPremium GPT-5.4 with maximum quality. 1M context. For the hardest problems$30.00$180.00
GPT-5.4 MiniStrong mini model for coding, computer use, and subagents. 400K context. Cached input: $0.075/1M$0.75$4.50
GPT-5.4 NanoCheapest GPT-5.4 model. 400K context. Cached input: $0.02/1M$0.20$1.25
GPT-5.2Previous flagship. Best for coding and agentic tasks. 400K context. Cached input: $0.175/1M$1.75$14.00
GPT-5.1Flagship model. 400K context. Cached input: $0.125/1M$1.25$10.00
GPT-5Flagship model. 400K context. Cached input: $0.125/1M$1.25$10.00
GPT-5 MiniFast, affordable GPT-5 variant. 400K context. Cached input: $0.025/1M$0.25$2.00
GPT-5 NanoMost affordable model. 400K context. Cached input: $0.005/1M$0.05$0.40
o3Reasoning model. 200K context. Internal reasoning tokens billed as output$2.00$8.00
o3 ProPremium reasoning. 200K context. Maximum accuracy on hard problems$20.00$80.00
o4-miniFast reasoning model. 200K context. Good balance of reasoning quality and cost$1.10$4.40
GPT-4.1Strong general purpose model. 1M token context window$2.00$8.00
GPT-4.1 MiniCost effective GPT-4.1 variant. 1M context$0.40$1.60
GPT-4.1 NanoBudget model with 1M context$0.10$0.40
GPT-4oMultimodal model with vision. 128K context$2.50$10.00
GPT-4o MiniFast and affordable multimodal. 128K context$0.15$0.60

Pros & Cons

Pros

  • The broadest model lineup of any AI provider: text, reasoning, image generation, real time voice, embeddings, speech to text, and moderation all under one platform
  • GPT-5.5, GPT-5.4, and GPT-5 families offer excellent price to performance ratio with up to 90% prompt caching discounts and 50% batch processing savings
  • 1M token context window on GPT-5.5, GPT-5.4, and GPT-4.1 families, the largest production context window available from a major provider
  • Structured outputs guarantee JSON Schema conformance, eliminating parsing failures in production applications
  • The most mature ecosystem: extensive documentation, client libraries in every major language, and the largest third party tooling community
  • Multiple pricing tiers (Batch, Flex, Standard, Priority) let you optimize the cost vs. speed tradeoff per request
  • Responses API combines built in tools (web search, file search, computer use, code interpreter) with simple API surface, reducing the complexity of building agent like applications
  • No credit card required to sign up, making it easy to get started and prototype

Cons

  • Reasoning models (o3, o4-mini) use internal reasoning tokens billed as output but not visible in responses, which can make costs unpredictable and significantly higher than expected
  • No open source models; all models are proprietary and can only be accessed through OpenAI's API (unlike DeepSeek or Meta's Llama)
  • Rate limits on lower usage tiers can be restrictive; higher limits require accumulating significant spend ($100 to $50,000+)
  • The self serve fine tuning platform is being wound down and is no longer accessible to new users, limiting customization options going forward
  • GPT-5.5 Pro and GPT-5.4 Pro models are extremely expensive ($30 input, $180 output per million tokens), making them impractical for most applications
  • Writing quality on GPT models is generally considered less natural and more formulaic compared to Claude's output for long form and nuanced content
  • The API ecosystem is consolidating (Assistants API is now legacy) but still has both Chat Completions and Responses API, which can be confusing for new developers choosing between them

How to get started

1

Create an account and get your API key

Sign up at platform.openai.com. No credit card required. Navigate to the API Keys section and create a new secret key. Copy it immediately as it will not be shown again. Store it securely as an environment variable.

2

Install the SDK and make your first API call

Install the official OpenAI SDK for your language (Python: pip install openai, Node.js: npm install openai). Set your API key as an environment variable (OPENAI_API_KEY). Make your first Chat Completions or Responses API call with a few lines of code.

3

Choose the right model for your use case

Start with GPT-5.4 Nano for cost sensitive tasks. Use GPT-5.4 Mini for general purpose applications. Use GPT-5.4 for demanding coding and agentic tasks. Use GPT-5.5 for the most complex reasoning and professional work. All GPT-5.5 and GPT-5.4 models support adjustable reasoning effort, so you can dial reasoning up or down per request. Experiment in the Playground before writing code.

4

Add function calling and structured outputs

Define functions that your model can call to interact with external systems. Use structured outputs with JSON Schema to guarantee response format. These two features are the foundation of building reliable, production grade AI applications.

5

Optimize costs with caching and batching

Enable prompt caching for 50% to 90% savings on repeated prompts and system messages. Use the Batch API for non urgent workloads at 50% off. Set spending limits and budget alerts in your dashboard. Monitor usage by model to identify cost optimization opportunities.

Deep dive

Detailed guides with comparisons, tips, and visuals for each feature.

Get notified about updates

We'll email you when this tool's pricing or features change.

Last updated: 2026-06-01