APIMart
Back to all models

GPT-5 mini API

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

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

View GPT-6.1 Terra

Use GPT-5 mini to answer support questions from your help center, pull fields out of forms into JSON, or review small code changes at high volume.

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 mini 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 mini.

Try GPT-5 mini with your own material

Answering from a help center

Send the customer’s question with the relevant help articles and ask GPT-5 mini for a short answer that links the article it used. Review a weekly sample of answers.

Example: How do I reset two-factor login?

Material

Customer question
I lost my phone and can’t log in because of two-factor. What do I do?
Help article “Recover your account”
Use one of your backup codes on the login screen. If you have none, submit the recovery form; we verify your identity within 2 business days.

PromptAnswer the customer using only the help article. Keep it under 60 words and name the article.

Sample answer · written by hand to show the reasoning

Sign in with one of your backup codes on the login screen. If you don’t have any, submit the account recovery form and we’ll verify your identity within 2 business days. Source: “Recover your account”.

About the GPT-5 mini API

  • Faster, cheaper GPT-5

    GPT-5 mini is a faster, more cost-efficient version of GPT-5, best for well-defined tasks and precise prompts.

  • Shutdown on December 11, 2026

    OpenAI deprecated GPT-5 mini on June 11, 2026 and recommends GPT-6.1 Terra 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. Function calling, structured outputs and streaming are supported.

  • GPT-5 mini API key and access

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

GPT-5 mini official benchmark results

Selected results OpenAI published at launch.

  • SWE-bench Verified

    71.0%

    Fixing real issues in code repositories. Ahead of o4-mini (68.1%) and GPT-4.1 mini (23.6%).

  • Aider polyglot (diff)

    71.6%

    Code edits across programming languages. Ahead of o4-mini (58.2%) and GPT-4.1 mini (31.6%).

  • Tau2-bench telecom

    74.1%

    Customer service agents calling tools. Ahead of GPT-4.1 mini (44.0%) and o4-mini (40.5%).

  • OpenAI-MRCR (2 needle, 128K)

    84.3%

    Finding the right detail in a long conversation. Ahead of o4-mini (56.4%) and GPT-4.1 mini (47.2%).

  • GPQA Diamond

    82.3%

    Graduate-level science questions without tools. Ahead of o4-mini (81.4%) and GPT-4.1 mini (65.0%).

  • MMMU

    81.6%

    College-level questions about images and diagrams. Equal to o4-mini (81.6%), ahead of GPT-4.1 mini (72.7%).

How to call the GPT-5 mini API

To call GPT-5 mini, 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-mini",
  "messages": [
    {
      "role": "user",
      "content": "Describe how to design a clear API in three sentences."
    }
  ],
  "stream": false
}'

GPT-5 mini access details

Model IDgpt-5-mini
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 mini API request parameters

GPT-5 mini 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-mini 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 mini API pricing

The GPT-5 mini 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
Input2Credits~$0.21.9Credits~$0.191.8Credits~$0.182.5Credits~$0.2520%
Cached input0.2Credits~$0.020.19Credits~$0.0190.18Credits~$0.0180.25Credits~$0.02520%
Output16Credits~$1.615.2Credits~$1.5214.4Credits~$1.4420Credits~$220%

Prices are for reference only. View full pricing

Why call GPT-5 mini API through APIMart

  • 20% below official pricing

    GPT-5 mini 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.02 per 1M tokens.

    See membership prices
  • One API key for 500+ models

    GPT-5 mini, 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 mini 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 mini API key works for every model in the table; just change the model parameter.

Differences between OpenAI models
ComparisonGPT-5 mini CurrentGPT-4oGPT-4o miniGPT-4o-2024-11-20GPT-4.1GPT-4.1 minio3GPT-5GPT-5 nanoGPT-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 forCost-efficient reasoning, Deprecated, 400K contextText 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 highFastest and cheapest, Deprecated, ClassificationHard 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.2$2$0.12$2$1.6$0.32$1.6$1$0.04$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$1.6$8$0.48$8$6.4$1.28$6.4$8$0.32$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 mini FAQ

Is GPT-5 mini being retired?

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

How do I migrate from GPT-5 mini to GPT-6.1 Terra?

Change the model parameter in your gpt-5-mini API requests to gpt-6.1-terra; the APIMart API key and endpoint stay the same. Re-run a sample of your real requests and compare quality, latency and cost 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 mini, 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.

What is the difference between GPT-5 mini, GPT-5 and GPT-5 nano?

All three share the 400,000-token context window. GPT-5 scores highest, for example 74.9% on SWE-bench Verified against 71.0% for mini and 54.7% for nano; mini costs much less than GPT-5, and nano is the fastest and cheapest, aimed at summarization and classification.

How can I try this model online?

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

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

Set model to gpt-5-mini. 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 mini?

On APIMart, GPT-5 mini 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 mini 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 mini API cost?

The GPT-5 mini API on APIMart is billed by token, and prices depend on your membership tier. Gold: $0.2 per million input tokens and $1.6 per million output tokens. Diamond: $0.18 per million input tokens and $1.44 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.