You can call GPT-5 mini directly through OpenAI’s API using the model ID gpt-5-mini and the Responses API. But there’s an important production caveat: OpenAI’s current model page marks GPT-5 mini as deprecated and recommends starting with GPT-5.6 Terra for most new low-latency, high-volume workloads. The page still lists GPT-5 mini’s endpoints, limits, and prices, but confirm it remains available to your organization before building a new integration around it. (developers.openai.com)
Make a direct OpenAI API request
The example below is for OpenAI directly—not a third-party router. You’ll need an OpenAI API key and Python with the official SDK installed. OpenAI’s quickstart shows setting the key as an environment variable; the Python SDK uses the Responses API as its primary interface and returns generated text through response.output_text. (OpenAI quickstart)
-
Install the SDK:
python -m pip install openai -
Create an API key in the OpenAI Platform and set it in your shell. On macOS or Linux:
export OPENAI_API_KEY="your_api_key_here"In PowerShell:
$env:OPENAI_API_KEY="your_api_key_here"Keep the key out of source code and version control. The SDK reads
OPENAI_API_KEYautomatically. (OpenAI quickstart) -
Save this as
example.pyand run it if GPT-5 mini is available to your API organization:from openai import OpenAI client = OpenAI() response = client.responses.create( model="gpt-5-mini", input="Explain quantum computing in one short paragraph.", ) print(response.output_text)Run it with
python example.py. The expected result is a text response printed in your terminal. OpenAI lists the model ID and Responses endpoint; the SDK call follows its documented Python pattern. (GPT-5 mini model page)
Responses API or Chat Completions?
OpenAI lists both v1/responses and v1/chat/completions for GPT-5 mini. For a new Python integration, the official SDK identifies Responses as its primary model interface; Chat Completions remains available. If you already use Chat Completions, note that Requesty examples are a separate, third-party setup: they use Requesty’s URL, key, and model identifier. Don’t mix those values with a direct OpenAI request. (GPT-5 mini model page)
GPT-5 mini inputs and integration features
OpenAI lists text and images as input modalities and text as the output modality for GPT-5 mini. Its model page also lists function calling and structured outputs as supported. These are model capability listings, not a complete request recipe: check the documentation for your chosen endpoint for the required tool or schema fields. The model page lists both Responses and Chat Completions endpoints. (developers.openai.com)
GPT-5 mini API pricing
OpenAI lists these per 1 million tokens for GPT-5 mini: (developers.openai.com)
| Token type | Listed price |
|---|---|
| Input | $0.25 |
| Cached input | $0.025 |
| Output | $2.00 |
The model page displays prices with $. Your usage cost depends on input, cached input, and output tokens—not just the number of API calls. For example, at the listed rates, a request using 100,000 uncached input tokens and 10,000 output tokens would cost $0.045: $0.025 for input plus $0.020 for output. This is an estimate from the listed rates, not a measured request cost; it excludes any other applicable charges or account-specific terms.
Context, output, and rate limits
OpenAI’s model page lists a 400,000-token context window and 128,000 maximum output tokens. It also explains that rate limits vary by usage tier. (developers.openai.com)
The same model page lists these GPT-5 mini limits by tier: (developers.openai.com)
| Tier | Requests per minute (RPM) | Tokens per minute (TPM) | Batch queue limit |
|---|---|---|---|
| Free | Not supported | — | — |
| Build | 5,000 | 2,000,000 | 20,000,000 |
| Launch | 10,000 | 10,000,000 | 1,000,000,000 |
| Grow | 30,000 | 180,000,000 | 15,000,000,000 |
These are the limits displayed on OpenAI’s GPT-5 mini model page, not a guarantee that your organization has those limits. Check your organization’s applicable limits and model access before launch, especially because the model is marked deprecated. The model page labels the third numeric column “Batch queue limit”; verify the applicable details in your account before using it for capacity planning. (developers.openai.com)
What to verify before production
- Model status and access: GPT-5 mini is marked deprecated. Confirm it is available to your organization and decide whether your use case justifies starting with a deprecated model. OpenAI’s page recommends GPT-5.6 Terra for most new low-latency, high-volume workloads. (GPT-5 mini model page)
- The right API surface: This example uses OpenAI’s Responses API. If adapting existing code, verify that your chosen endpoint and SDK method match your application. OpenAI lists both Responses and Chat Completions for GPT-5 mini. (GPT-5 mini model page)
- Your real cost: Estimate uncached input, cached input, and output separately using the listed rates; compare the estimate with actual usage in your account.
- Your organization’s limits: Check the limits that apply to your account rather than assuming a tier from the model page. (GPT-5 mini model page)
- Sensitive data and operational behavior: Before sending production traffic, review the terms that apply to your account and test how your application handles failed or incomplete requests. This article does not establish account-specific data terms or a retry policy.
FAQ
What is the direct OpenAI model ID for GPT-5 mini?
OpenAI lists gpt-5-mini. The identifier openai/gpt-5-mini shown in some examples is for Requesty-mediated access, while openai__gpt_5_mini appears in Box documentation; neither should be substituted into this direct OpenAI example. (GPT-5 mini model page)
Is GPT-5 mini deprecated?
Yes. OpenAI’s current model page labels GPT-5 mini deprecated. That page does not state a shutdown date in the model details cited here, so don’t infer one; confirm availability before deployment. (GPT-5 mini model page)
Does a ChatGPT subscription include API usage?
OpenAI says API usage is billed separately from ChatGPT subscriptions. Check your API Platform billing and usage before sending paid traffic. (OpenAI billing help)
Should I use GPT-5 mini for a new production integration?
Only if you have a specific reason to use it and confirm it remains available to your organization. OpenAI marks it deprecated and recommends GPT-5.6 Terra as the starting point for most new low-latency, high-volume workloads. Compare available models against your own quality, latency, and cost requirements before choosing. (GPT-5 mini model page)
Sources
Developer quickstart | OpenAI API
OpenAI Python API library | OpenAI API Reference
Managing billing for ChatGPT and the API platform
