Skip to content
OpenAI · GPT-5

gpt-5-nano API

gpt-5-nano brings OpenAI GPT-5 text generation to Openrouter API for cost-conscious chat workflows.

ChatChat & TextSynchronousPrompt caching
Model id
gpt-5-nano

gpt-5-nano API pricing

All prices in USD. Openrouter API rates compared with the official list price for the same unit.

Token typeOpenrouter APIOfficialSave
Input per 1M tokens$0.044$0.05−12%
Cached input per 1M tokens$0.0044$0.005−12%
Output per 1M tokens$0.352$0.40−12%

What is gpt-5-nano?

gpt-5-nano is an OpenAI chat model in the GPT-5 family, available through Openrouter API. Its nano naming positions it as a lighter, cost-conscious tier, suited to teams evaluating routine text-generation and conversational workloads. Send text messages with user, system, and assistant roles to define the task and supply conversation history. The documented Chat Completions interface offers streaming or complete responses, plus controls for output length and sampling. The model supports up to 272,000 input tokens, up to 128,000 output tokens, and prompt-cache reads.

Call gpt-5-nano using Openrouter API's OpenAI-compatible base URL, https://openrouterapi.ru/v1, and your Openrouter API key. Pricing is pay-as-you-go: $0.044 per 1M tokens for input, $0.0044 per 1M tokens for cached input, and $0.352 per 1M tokens for output. The default configuration is about 12% below the developer's list price, and Openrouter API bills only for successful requests.

gpt-5-nano highlights

Large Input Allowance

Supply up to 272,000 input tokens for text-generation requests with substantial source material or conversation history.

Output Length Control

The model supports up to 128,000 output tokens. Use the documented max_tokens parameter to set a generation ceiling for your task.

Prompt-Cache Reads

Cached input reads cost $0.0044 per 1M tokens, compared with $0.044 per 1M tokens for regular input.

Compatible Chat Interface

Use the OpenAI Chat Completions request format with role-based messages. The documented interface supports SSE streaming or a complete response.

How to call the gpt-5-nano API in 4 steps

  1. 01

    Get an API key

    Sign in to Openrouter API, top up from $50, and create an sk-ora key in the console.

  2. 02

    Set the base URL

    Use https://openrouterapi.ru/v1 as the base URL in your SDK or HTTP client.

  3. 03

    Send the request

    Call POST /v1/chat/completions with "model": "gpt-5-nano" and the parameters below.

  4. 04

    Handle the response

    Read the response (or stream tokens with stream: true). Usage and cost appear in your console.

curl https://openrouterapi.ru/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTERAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5-nano",
    "messages": [
      {"role": "system", "content": "You are a concise assistant."},
      {"role": "user", "content": "Explain what an AI API gateway does in two sentences."}
    ],
    "stream": false
  }'

Parameters

ParameterTypeRequiredDefaultDescription
modelstringRequiredgpt-5Model name
messagesarrayRequired—List of conversation messages
rolestringRequireduserRole type
contentstringRequired—Message content
temperaturenumberOptional—Controls output randomness, range 0-2
max_tokensintegerOptional—Maximum number of tokens to generate
streambooleanOptional—Whether to use streaming output
top_pnumberOptional—Nucleus sampling parameter, range 0-1
frequency_penaltynumberOptional—Frequency penalty, range -2.0 to 2.0
presence_penaltynumberOptional—Presence penalty, range -2.0 to 2.0
stopstring or arrayOptional—Stop sequences
nintegerOptional—Number of completions to generate

What you can build with gpt-5-nano

Routine Chat Assistance

Evaluate the nano tier for conversational assistants that answer everyday questions using supplied instructions and conversation history.

Document Summaries

Provide source text and ask for concise summaries, using an output token ceiling to keep responses focused.

Drafting Workflows

Build text-drafting tools for internal messages or support replies, with a system message defining tone and requirements.

Text Review Queues

Evaluate the model for reviewing incoming text and returning requested labels or short explanations. Validate results against your team's examples before deployment.

Tips for better results

  • 01

    Set the Model Explicitly

    Set the model field to gpt-5-nano; the documented Chat API defaults to a different model when no selection is made.

  • 02

    Budget Output Tokens

    Use max_tokens to limit generated text to what your application needs. Output is billed at $0.352 per 1M tokens.

  • 03

    Track Cached Usage

    Account for prompt-cache reads separately when estimating costs. The cache-read rate is $0.0044 per 1M tokens; do not assume every input qualifies.

  • 04

    Choose Response Delivery

    Set stream to true for SSE output or false for a complete response. Explicitly setting it avoids relying on an endpoint's default.

Limits and things to know

  • Maximum input is 272,000 tokens; maximum output is 128,000 tokens.

  • General API parameter documentation does not establish that every option is supported by this specific model; check model-specific guidance.

  • Published information does not establish image input, tool support, or Responses API availability for this model.

gpt-5-nano API FAQ

How much does gpt-5-nano cost on Openrouter API?

Input costs $0.044 per 1M tokens, cached input costs $0.0044 per 1M tokens, and output costs $0.352 per 1M tokens. The default configuration is about 12% below the developer's list price, with pay-as-you-go billing only for successful requests.

How do I call gpt-5-nano through Openrouter API?

Use https://openrouterapi.ru/v1 as your OpenAI-compatible base URL and send a POST request to /chat/completions. Authenticate with your Openrouter API key as a Bearer token, set model to gpt-5-nano, and provide a messages array.

Which request controls are documented?

The general Chat API documents max_tokens, stream, temperature, top_p, frequency_penalty, presence_penalty, stop, and n. Confirm model-specific compatibility before relying on individual optional controls.

What are gpt-5-nano's token limits?

The maximum input is 272,000 tokens and the maximum output is 128,000 tokens. These are separate limits, not a stated combined context allowance.

Can I use gpt-5-nano commercially?

Commercial use is subject to the model developer's terms. Review the applicable OpenAI and Openrouter API terms for your intended application.

How does gpt-5-nano compare with other GPT-5 models?

The nano name positions it as a lighter, cost-conscious tier within GPT-5. Published information does not include comparative quality or latency benchmarks, so evaluate it on your own workload before choosing among siblings.

Related models

Depth: 250+ models · Minimum top-up $50

Start building with gpt-5-nano

One key, pay as you go from $50, billed only for successful requests.