GPT-5 API

GPT-5 is OpenAI's most advanced language model with a 400K token context window and superior reasoning capabilities.

Modalities
Text, ImageText
In / Out price
$1.25/$10per 1M
Context window
400K tokens
Released
Aug 7, 2025

GPT-5 overview

The pelican test: one prompt, every text model, unedited SVG output from Nov 3, 2026.

SVG of a pelican riding a bicycle, written by GPT-5 through AI/ML API

GPT-5 by OpenAI

It delivers enhanced reasoning, deeper memory retention, and superior accuracy across diverse domains such as coding, scientific analysis, and large-scale document processing, with robust safety and bias mitigation systems.

GPT-5 specs

Model ID
openai/gpt-5-2025-08-07
Developer
OpenAI
Context window
400,000 tokens
Max output
128,000 tokens
Input
Text, Image
Output
Text
API
OpenAI-compatible, base URL https://api.aimlapi.com/v1

What Is GPT-5 API?

GPT-5 is OpenAI’s most capable large language model to date. Launched on August 7, 2025, it introduces a unified architecture that intelligently routes between a fast everyday model, a deeper “thinking” reasoning engine, and a real-time decision layer that knows exactly when to go deep.

With a massive 400,000-token context window, native vision support, and major leaps in instruction following, tool use, and factual accuracy. It crushes benchmarks in coding, math, scientific reasoning, and long-context analysis while staying fast and cost-effective for high-volume workloads.

Technical Specifications & Performance

  • Context window: 400,000 tokens (input + output combined)
  • Multimodal: Text + vision (images up to industry-leading file sizes)
  • Reasoning modes: Adaptive + explicit control (minimal, low, medium, high, xhigh on newer snapshots)

Performance Benchmarks

  • Speed & Latency: GPT-5 delivers faster inference times compared to GPT-4.1, benefiting from architectural optimizations and pricing incentives for cached input tokens.
  • Accuracy: Improved few-shot learning and factual correctness across benchmarks in coding, legal document analysis, and scientific domains.
  • Multilingual support: Expanded language coverage beyond GPT-4.1 capabilities, with superior translation and culturally nuanced understanding.

Architecture Breakdown

GPT-5 is built on an advanced transformer framework with optimized attention mechanisms and energy-efficient Mixture of Experts (MoE) layers. Recursive training and enhanced context management enable dynamic focus on salient information, improving both computational speed and accuracy over prior generation models.

Built-In Adaptive Reasoning

GPT-5 automatically decides when to use “thinking” mode for hard problems. Need step-by-step logic on a tricky algorithm? It goes deep. Need a fast answer? It stays snappy. You can also explicitly control reasoning effort (minimal → high) for predictable behavior and cost.

Massive 400K Context Window

Process entire codebases, 200-page PDFs, hours of meeting transcripts, or long customer histories in a single prompt. No more chunking, summarizing, or losing the plot halfway through.

Use cases

  • Software engineering workflows, including advanced code generation, debugging, and multi-file refactoring.
  • Large-scale document analysis for sectors like legal, finance, healthcare, and regulatory compliance.
  • Multimodal content creation and understanding, blending text and images seamlessly.
  • Creative writing, education, and research assistance with multi-step instruction execution and detailed reasoning.

Capabilities

  • Function calling
  • Streaming
  • Structured outputs
  • Reasoning
  • Web search

GPT-5 benchmarks by Artificial Analysis

See how GPT-5 compares in generation speed. Data retrieved Nov 3, 2026.

Speed

Output tokens / second

Benchmark results

Compare 17 models available on AI/ML API across 5 independent benchmarks.

Humanity's Last Exam

Expert-written questions across academic subjects.

GPT-5 API pricing

GPT-5 pricing in US dollars
UsagePriceUnit
Input$1.251M tokens
Output$101M tokens
Cached input$0.1251M tokens

Prices from the AI/ML API price list, checked on Nov 4, 2026.

GPT-5 vs other models: token prices

AI/ML API input and output rates for 5 models, per million tokens.

AI/ML API model prices in USD per million tokens
ModelInputOutput
GPT-5$1.25$10
GPT-6 Luna$0.1$0.5
GPT-6.1 Terra$1$5
GPT-6.1 Sol$2$10
GPT-6.1 Terra Pro$2.12$10.58

How to use the GPT-5 API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "openai/gpt-5-2025-08-07",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'

Related articles

All posts

GPT-5 FAQ

What is the context window of GPT-5?

GPT-5 has a 400,000 tokens context window and can return up to 128,000 tokens.

What inputs and outputs does GPT-5 support?

GPT-5 takes image, text as input and returns text.

What is the model ID for GPT-5?

Use openai/gpt-5-2025-08-07 as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.

How much does GPT-5 cost?

GPT-5 costs $1.25 input and $10 output per 1M tokens on AI/ML API, billed as you go with no subscription.

Does GPT-5 support streaming?

Yes, GPT-5 can stream responses as they are generated.

Can GPT-5 read images?

Yes, GPT-5 accepts image input alongside text.

Who created GPT-5?

GPT-5 was built by OpenAI.

Start building with GPT-5

GPT-5 API

openai/gpt-5-2025-08-07

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "openai/gpt-5-2025-08-07",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'