APIMart
Back to all models

GPT-5 nano API

OpenAIModel ID gpt-5-nanoText modelReleased August 7, 2025

GPT-5 nano will be retired on December 11, 2026, after which API calls will stop working. We recommend migrating to GPT-6 Luna ahead of time.

View GPT-6 Luna

Use GPT-5 nano to tag thousands of reviews by topic, summarize support chats in one line, or route incoming emails to the right team at very low cost.

Max input
272,000 tokens
Max output
128,000 tokens
Input → output
Text, Image → Text
Knowledge cutoff
May 31, 2024
  • Image input
  • Streaming
  • Cached input pricing
  • OpenAI SDK compatible

GPT-5 nano API use cases

Each use case comes with an illustrative example: source material, a prompt and a hand-written sample answer, not actual model output. Copy the prompt, swap in your own material and try it on GPT-5 nano.

Try GPT-5 nano with your own material

Tagging reviews and feedback

Send each review with your tag list and ask GPT-5 nano for one or two tags. Check a sample every week and refine the tag definitions where it hesitates.

Example: Which topics does this review mention?

Material

Customer review
Arrived a week late, but the jacket itself is excellent and warm.

PromptTag the review with one or two of: delivery, quality, price, support. Reply with the tags only.

Sample answer · written by hand to show the reasoning

delivery, quality

About the GPT-5 nano API

  • Fastest, cheapest GPT-5

    GPT-5 nano is the fastest, cheapest version of GPT-5, built for summarization and classification at high volume.

  • Shutdown on December 11, 2026

    OpenAI deprecated GPT-5 nano on June 11, 2026 and recommends GPT-6 Luna as the replacement.

  • 400K context, 128K output

    The context window is 400,000 tokens, with up to 272,000 tokens of input and 128,000 of output. Structured outputs keep labels and routes in a fixed format.

  • GPT-5 nano API key and access

    You don’t need a separate GPT-5 nano API key: one APIMart key works for every model, including GPT-6 Luna. Send gpt-5-nano API requests with the model ID gpt-5-nano; GPT-5 nano API pricing is in the table on this page.

GPT-5 nano official benchmark results

Selected results OpenAI published at launch.

  • SWE-bench Verified

    54.7%

    Fixing real issues in code repositories. Level with GPT-4.1 (54.6%), well ahead of GPT-4.1 mini (23.6%).

  • Aider polyglot (diff)

    48.4%

    Code edits across programming languages. Ahead of GPT-4.1 nano (6.2%).

  • GPQA Diamond

    71.2%

    Graduate-level science questions without tools. Ahead of GPT-4.1 nano (50.3%).

  • MMMU

    75.6%

    College-level questions about images and diagrams. Ahead of GPT-4.1 nano (55.4%).

  • OpenAI-MRCR (2 needle, 128K)

    43.2%

    Finding the right detail in a long conversation. Ahead of GPT-4.1 nano (36.6%).

  • Tau2-bench telecom

    35.5%

    Customer service agents calling tools. Ahead of GPT-4.1 nano (12.1%); use a larger model for complex agents.

How to call the GPT-5 nano API

To call GPT-5 nano, you only need an APIMart API key and your existing OpenAI SDK, or send plain HTTP requests.

POST /v1/chat/completions
curl https://api.apimart.ai/v1/chat/completions \
  -H "Authorization: Bearer $APIMART_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-5-nano",
  "messages": [
    {
      "role": "user",
      "content": "Describe how to design a clear API in three sentences."
    }
  ],
  "stream": false
}'

GPT-5 nano access details

Model IDgpt-5-nano
Base URLhttps://api.apimart.ai/v1
Endpoint/chat/completions

Common parameters

model
Required
messages
Required
stream
Optional
max_tokens
Optional
temperature
Optional
All request parameters, response fields and error codes

GPT-5 nano API request parameters

GPT-5 nano uses the general chat endpoint, POST /v1/chat/completions, with a JSON body. model and messages are required; every other parameter is optional.

ParameterTypeRequiredDescription
modelstringYesModel ID. Use gpt-5-nano for this model.
messagesarrayYesConversation messages. Each message has a role (system, user, or assistant) and content. Include earlier messages for multi-turn conversations.
streambooleanNoWhether to stream the output. true returns chunks over SSE, false returns the full response at once. Default: true.
temperaturenumberNoOutput randomness, 0–2. Default: 1.0. Lower values give more deterministic output.
top_pnumberNoNucleus sampling, 0–1. Default: 1.0. Adjust this or temperature, not both.
max_tokensintegerNoMaximum number of tokens to generate for the reply.
frequency_penaltynumberNoFrequency penalty, -2.0 to 2.0. Default: 0. Positive values reduce repeated wording.
presence_penaltynumberNoPresence penalty, -2.0 to 2.0. Default: 0. Positive values encourage new topics.
stopstring | arrayNoUp to 4 stop sequences. Generation stops when any of them appears.
nintegerNoNumber of replies to generate. Default: 1.

Response fields

The response contains the fields below. Token usage is returned in usage, which you can use to check costs.

FieldTypeDescription
idstringUnique identifier for the request.
modelstringThe model that handled the request.
choicesarrayList of replies. Each item contains message (role and content) and finish_reason.
usageobjectToken usage: prompt_tokens, completion_tokens, and total_tokens.

Error codes

Failed requests return an error object with code, message, and type.

StatusTypeMeaning
400invalid_request_errorInvalid request parameters.
401authentication_errorThe API key is invalid or missing.
402payment_requiredInsufficient account balance.
403permission_errorNo permission to access this resource.
429rate_limit_errorToo many requests. Retry later.
500server_errorInternal server error.
502bad_gatewayGateway error. The service is temporarily unavailable.

GPT-5 nano API pricing

The GPT-5 nano API is billed by token usage, and prices depend on your membership tier. Prices below are per million tokens; 1 US dollar = 10 credits.

ItemGoldCurrent pricePlatinumDiamondOfficial priceYou save
Input0.4Credits~$0.040.38Credits~$0.0380.36Credits~$0.0360.5Credits~$0.0520%
Cached input0.04Credits~$0.0040.038Credits~$0.00380.036Credits~$0.00360.05Credits~$0.00520%
Output3.2Credits~$0.323.04Credits~$0.3042.88Credits~$0.2884Credits~$0.420%

Prices are for reference only. View full pricing

Why call GPT-5 nano API through APIMart

  • 20% below official pricing

    GPT-5 nano API pricing is billed by token usage. Gold to Diamond member prices are 20%–28% below OpenAI's official prices, and cached input costs just $0.004 per 1M tokens.

    See membership prices
  • One API key for 500+ models

    GPT-5 nano, the rest of its family and 500+ models from GPT, Claude, Gemini and more share one API key and one account balance. Switching models is just a change to the model parameter.

  • Change two lines of existing code

    If you already use the OpenAI SDK, point base_url at https://api.apimart.ai/v1 and swap in your APIMart API key. Requests and responses keep the same format.

  • Try it online before you code

    Try GPT-5 nano with your own material in the Playground, no code or setup needed, and integrate once you like the results.

    Open Playground

Which OpenAI model should you choose?

Base prices per 1M tokens (USD). Your GPT-5 nano API key works for every model in the table; just change the model parameter.

Differences between OpenAI models
ComparisonGPT-5 nano CurrentGPT-4oGPT-4o miniGPT-4o-2024-11-20GPT-4.1GPT-4.1 minio3GPT-5GPT-5 miniGPT-5 ProGPT-5 SearchGPT-5.1GPT-5.2GPT-5.2 ProGPT-5.3-CodexGPT-5.4GPT-5.4 miniGPT-5.4 nanoGPT-5.4 ProGPT-5.5GPT-5.6 LunaGPT-5.6 SolGPT-5.6 TerraGPT-6 AstraGPT-6 LunaGPT-6 SolGPT-6.1 SolGPT-6.1 TerraGPT-6.2 AstraGPT-6.2 Sol
Best forFastest and cheapest, Deprecated, ClassificationText and image input, Function calling and structured outputs, No reasoning step, fast repliesHigh-volume classification and extraction, Text and image input, Low-cost small modelNewest GPT-4o snapshot, Text and image input, No reasoning step, fast repliesInstruction following, Deprecated, 1M-token contextFast and low-cost, Deprecated, 1M-token contextDeep reasoning, Visual reasoning, Coding and technical writingCoding and agents, Deprecated, Reasoning effort minimal to highCost-efficient reasoning, Deprecated, 400K contextHard reasoning, Deprecated, Responses APIWeb search in Chat Completions, Searches before every answer, Text in, text outCoding and agents, Deprecated, Text and image inputProfessional work, Reasoning up to xhigh, Text and image inputHard reasoning, More compute per request, Responses APIAgentic coding, 400K context, Responses APICoding and professional work, 1.05M context, Text and image inputCoding and subagents, 400K context, Text and image inputClassification and extraction, Cheapest GPT-5.4 model, Text and image inputHard reasoning, More compute per request, Text and image inputCoding and professional work, 1.05M context, Reasoning from none to xhighHigh-volume tasks, Classification, Data extractionComplex professional work, Coding and debugging, Text and image inputBalanced cost, Support and review, Text and image inputComplex coding, Professional work, ResearchStructured summaries, Classification, Data extractionComplex coding, Agentic workflows, Testing and debuggingComplex coding, Professional documents, Business workflowsVisual reasoning, Drawings and screenshots, WritingComplex coding, Long-document analysis, Professional researchEveryday coding, Agentic tasks, Writing
Input typesText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageTextText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, Image
Max input272,000 tokens128,000 tokens128,000 tokens128,000 tokens1,047,576 tokens1,047,576 tokens200,000 tokens272,000 tokens272,000 tokens272,000 tokens272,000 tokens272,000 tokens272,000 tokens272,000 tokens272,000 tokens922,000 tokens272,000 tokens272,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens
Max output128,000 tokens16,384 tokens16,384 tokens16,384 tokens32,768 tokens32,768 tokens100,000 tokens128,000 tokens128,000 tokens272,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens
Knowledge cutoffMay 31, 2024October 1, 2023October 1, 2023October 1, 2023June 1, 2024June 1, 2024June 1, 2024September 30, 2024May 31, 2024September 30, 2024—September 30, 2024August 31, 2025August 31, 2025August 31, 2025August 31, 2025August 31, 2025August 31, 2025August 31, 2025December 1, 2025February 16, 2026February 16, 2026February 16, 2026April 30, 2026May 18, 2026April 20, 2026April 30, 2026June 1, 2026May 18, 2026June 1, 2026
Input price$0.04$2$0.12$2$1.6$0.32$1.6$1$0.2$12$1$1$1.4$16.8$1.4$2$0.6$0.16$24$4$0.16$3.2$1.6$8$0.08$1.6$1.6$0.8$6.4$1.6
Output price$0.32$8$0.48$8$6.4$1.28$6.4$8$1.6$96$8$8$11.2$134.4$11.2$12$3.6$1$144$24$0.96$16$9.6$40$0.4$8$8$4$32$8

GPT-5 nano FAQ

Is GPT-5 nano being retired?

Yes. OpenAI deprecated gpt-5-nano and its snapshot gpt-5-nano-2025-08-07 on June 11, 2026, with a shutdown date of December 11, 2026. The recommended replacement is GPT-6 Luna.

How do I migrate from GPT-5 nano to GPT-6 Luna?

Change the model parameter in your gpt-5-nano API requests to gpt-6-luna; the APIMart API key and endpoint stay the same. Re-run a sample of your classification and summarization prompts and compare the labels before switching all traffic.

Is the context window 400,000 or 272,000 tokens?

OpenAI lists a total context window of 400,000 tokens for GPT-5 nano, of which up to 272,000 tokens are input and up to 128,000 tokens are reasoning and output. This page lists max input and max output separately.

When should I use GPT-5 nano instead of GPT-5 mini?

Use nano for short, well-defined jobs such as tagging, routing and one-line summaries, where speed and cost matter most. For multi-step tool use or code changes, GPT-5 mini scores much higher, for example 74.1% vs. 35.5% on Tau2-bench telecom.

How can I try this model online?

Click Start chatting or Open Playground to visit the existing APIMart Playground. Select GPT-5 nano in the text category to start exploring.

Which model ID does the GPT-5 nano API use?

Set model to gpt-5-nano. Copy the exact ID from the page heading or the integration details panel.

Is it compatible with the OpenAI SDK?

You can keep the OpenAI SDK. Set base_url to https://api.apimart.ai/v1, provide your APIMart API key, and use the model ID on this page.

What is the context window of GPT-5 nano?

On APIMart, GPT-5 nano accepts up to 272,000 input tokens per request. Your prompt, earlier messages, and file content all count toward it.

How many tokens can it output at once?

GPT-5 nano can output up to 128,000 tokens in a single reply. Use the max_tokens parameter to set a lower limit.

How much does the GPT-5 nano API cost?

The GPT-5 nano API on APIMart is billed by token, and prices depend on your membership tier. Gold: $0.04 per million input tokens and $0.32 per million output tokens. Diamond: $0.036 per million input tokens and $0.288 per million output tokens. Prices may change; the pricing page has the current rates.

Does it support streaming?

Yes. The general chat endpoint streams over SSE by default. Set stream to false to receive the complete response at once.

How do I get an API key?

Sign in to APIMart and create a key on the API Keys page, then send it in the Authorization: Bearer header. The same key also works for other models on the platform.