---
title: GPT 5 Mini API | Text Generation | ModelsLab
description: Cost-efficient LLM with 400K input context, supporting text & image inputs, ideal for fast and precise chat tasks.
url: https://modelslab.com/models/openai/gpt-5-mini/api.md
canonical: https://modelslab.com/models/openai/gpt-5-mini/api.md
type: product
component: Playground/LLM/Index
generated_at: 2026-04-24T23:26:11.741943Z
---

GPT-5-mini
---

 [LLMs.txt](https://modelslab.com/models/openai/gpt-5-mini/llms.txt) [.md](https://modelslab.com/models/openai/gpt-5-mini.md)

gpt-5-mini openai Closed Source Model $1.125000 / call

GPT-5-mini
---

Choose a prompt below to get started or type your own message

 Explain quantum computing in simple terms

 Write a Python function to sort a list

 Create a marketing email for a SaaS product

 Compare REST vs GraphQL APIs

Send

### GPT-5-mini

openai gpt-5-mini

Copy model ID

PricingInput $0.25 / 1M tokens

Output $2.00 / 1M tokens

API EndpointsOpenAI Compatible

`https://modelslab.com/api/v7/llm/chat/completions`Endpoint

Anthropic Compatible

`https://modelslab.com/api/v7/llm/v1/messages`Messages

`https://modelslab.com/api/v7/llm/v1/messages/count_tokens`Count Tokens

`https://modelslab.com/api/v7/llm/v1/models`Models

Use with Claude Code

cURL Example

ParametersSystem MessageYou are a helpful AI assistant specialized in providing accurate and detailed responses.

Temperature0.7

Max Tokens1000

Top P0.9

Frequency Penalty0

Presence Penalty0

Model Info

Support

Related Models
---

Discover similar models you might be interested in

 [View all LLM Models](https://modelslab.com/models?feature=llmaster)

[MS](https://modelslab.com/models/together_ai/mistralai-Mistral-Small-24B-Instruct-2501)[Together AI](https://modelslab.com/models/together_ai)

 [Mistral Small (24B) Instruct 25.01

Closed Source Model](https://modelslab.com/models/together_ai/mistralai-Mistral-Small-24B-Instruct-2501)

[PS](https://modelslab.com/models/open_router/perplexity-sonar-reasoning-pro)[Open Router](https://modelslab.com/models/open_router)

 [Perplexity: Sonar Reasoning Pro

Closed Source Model](https://modelslab.com/models/open_router/perplexity-sonar-reasoning-pro)

[DV](https://modelslab.com/models/together_ai/deepseek-ai-DeepSeek-V3.1-Base)[Together AI](https://modelslab.com/models/together_ai)

 [Deepseek V3.1 Base

Closed Source Model](https://modelslab.com/models/together_ai/deepseek-ai-DeepSeek-V3.1-Base)

[MW](https://modelslab.com/models/open_router/mancer-weaver)[Open Router](https://modelslab.com/models/open_router)

 [Mancer: Weaver (alpha)

Closed Source Model](https://modelslab.com/models/open_router/mancer-weaver)

[GG](https://modelslab.com/models/open_router/google-gemma-3n-e4b-it-free)[Open Router](https://modelslab.com/models/open_router)

 [Google: Gemma 3n 4B (free)

Closed Source Model](https://modelslab.com/models/open_router/google-gemma-3n-e4b-it-free)

[OG](https://modelslab.com/models/open_router/openai-gpt-5.4-mini)[Open Router](https://modelslab.com/models/open_router)

 [OpenAI: GPT-5.4 Mini

Closed Source Model](https://modelslab.com/models/open_router/openai-gpt-5.4-mini)

[G3](https://modelslab.com/models/together_ai/google-gemma-3-4b-it)[Together AI](https://modelslab.com/models/together_ai)

 [Gemma 3 4b it

Closed Source Model](https://modelslab.com/models/together_ai/google-gemma-3-4b-it)

[AA](https://modelslab.com/models/open_router/aion-labs-aion-1.0-mini)[Open Router](https://modelslab.com/models/open_router)

 [AionLabs: Aion-1.0-Mini

Closed Source Model](https://modelslab.com/models/open_router/aion-labs-aion-1.0-mini)

[MK](https://modelslab.com/models/open_router/moonshotai-kimi-k2-thinking)[Open Router](https://modelslab.com/models/open_router)

 [MoonshotAI: Kimi K2 Thinking

Closed Source Model](https://modelslab.com/models/open_router/moonshotai-kimi-k2-thinking)

[OG](https://modelslab.com/models/open_router/openai-gpt-3.5-turbo)[Open Router](https://modelslab.com/models/open_router)

 [OpenAI: GPT-3.5 Turbo

Closed Source Model](https://modelslab.com/models/open_router/openai-gpt-3.5-turbo)

[ML](https://modelslab.com/models/open_router/meta-llama-llama-3.3-70b-instruct-free)[Open Router](https://modelslab.com/models/open_router)

 [Meta: Llama 3.3 70B Instruct (free)

Closed Source Model](https://modelslab.com/models/open_router/meta-llama-llama-3.3-70b-instruct-free)

[L4](https://modelslab.com/models/together_ai/meta-llama-Llama-4-Scout-17B-16E)[Together AI](https://modelslab.com/models/together_ai)

 [Llama 4 Scout (17Bx16E)

Closed Source Model](https://modelslab.com/models/together_ai/meta-llama-Llama-4-Scout-17B-16E)

[ML](https://modelslab.com/models/meta/meta-llama-Llama-3.2-90B-Vision-Instruct-Turbo)[ModelsLab](https://modelslab.com/models/meta)

 [Meta Llama 3.2 90B Vision Instruct Turbo

Closed Source Model](https://modelslab.com/models/meta/meta-llama-Llama-3.2-90B-Vision-Instruct-Turbo)

[LL](https://modelslab.com/models/open_router/liquid-lfm-2.5-1.2b-thinking-free)[Open Router](https://modelslab.com/models/open_router)

 [LiquidAI: LFM2.5-1.2B-Thinking (free)

Closed Source Model](https://modelslab.com/models/open_router/liquid-lfm-2.5-1.2b-thinking-free)

[RF](https://modelslab.com/models/open_router/rekaai-reka-flash-3)[Open Router](https://modelslab.com/models/open_router)

 [Reka Flash 3

Closed Source Model](https://modelslab.com/models/open_router/rekaai-reka-flash-3)

[Q7](https://modelslab.com/models/open_router/qwen-qwen-2.5-72b-instruct)[Open Router](https://modelslab.com/models/open_router)

 [Qwen2.5 72B Instruct

Closed Source Model](https://modelslab.com/models/open_router/qwen-qwen-2.5-72b-instruct)

[MK](https://modelslab.com/models/open_router/moonshotai-kimi-k2-0905)[Open Router](https://modelslab.com/models/open_router)

 [MoonshotAI: Kimi K2 0905

Closed Source Model](https://modelslab.com/models/open_router/moonshotai-kimi-k2-0905)

[Q4](https://modelslab.com/models/together_ai/Qwen-Qwen3-4B-Instruct-2507)[Together AI](https://modelslab.com/models/together_ai)

 [Qwen3 4B Instruct 2507

Closed Source Model](https://modelslab.com/models/together_ai/Qwen-Qwen3-4B-Instruct-2507)

About GPT-5-Mini
---

GPT-5 Mini is a balanced, efficient GPT-5 variant, offering good reasoning at lower cost. It’s ideal for everyday tasks, faster than full GPT-5 but smarter than Nano.

### Technical Specifications

Model IDgpt-5-miniCategoryLLM ModelsTaskText GenerationPrice$1.125000 per million tokensAddedAugust 7, 2025

### Key Features

- Chat completion and multi-turn conversation API
- Streaming response with token-by-token output
- Function calling and tool use support
- System prompts and role-based messaging
- JSON mode and structured output

### Quick Start

Integrate GPT-5-Mini into your application with a single API call. Get your API key from the [pricing page](https://modelslab.com/pricing) to get started.

PythonJavaScriptcURLPHP

```
<code>import requests
import json

url = "https://modelslab.com/api/v7/llm/chat/completions"

headers = {
    "Content-Type": "application/json"
}

data = {
        "model_id": "gpt-5-mini",
        "messages": [
            {
                "role": "user",
                "content": "Hello!"
            }
        ],
        "max_tokens": 1000,
        "key": "YOUR_API_KEY"
    }

try:
    response = requests.post(url, headers=headers, json=data)
    response.raise_for_status()  # Raises an HTTPError for bad responses (4XX or 5XX)
    result = response.json()
    print("API Response:")
    print(json.dumps(result, indent=2))
except requests.exceptions.HTTPError as http_err:
    print(f"HTTP error occurred: {http_err} - {response.text}")
except Exception as err:
    print(f"Other error occurred: {err}")</code>
```

View the [full API documentation](https://modelslab.com/models/openai/gpt-5-mini/api) for SDKs, code examples in Python, JavaScript, and more.

### Pricing

GPT-5-Mini API costs $1.125000 per million tokens. Pay only for what you use with no minimum commitments. [View pricing plans](https://modelslab.com/pricing)

### Use Cases

- AI chatbots and virtual assistants
- Code generation and developer tools
- Content writing and copywriting automation
- Data analysis, summarization, and extraction

[Learn more about GPT-5-Mini](https://modelslab.com/gpt-5-mini) [Browse LLM Models](https://modelslab.com/models?feature=llmaster) [More from Openai](https://modelslab.com/models/open_router) [View Pricing](https://modelslab.com/pricing)

GPT-5-Mini FAQ
---

### What is GPT-5-Mini?

GPT-5 Mini is a balanced, efficient GPT-5 variant, offering good reasoning at lower cost. It’s ideal for everyday tasks, faster than full GPT-5 but smarter than Nano.

### How do I use the GPT-5-Mini API?

You can integrate GPT-5-Mini into your application with a single API call. Sign up on ModelsLab to get your API key, then use the model ID "gpt-5-mini" in your API requests. We provide SDKs for Python, JavaScript, and cURL examples in the API documentation.

### How much does GPT-5-Mini cost?

GPT-5-Mini costs $1.125000 per million tokens. ModelsLab uses pay-per-use pricing with no minimum commitments. A free tier is available to get started.

### What is the GPT-5-Mini model ID?

The model ID for GPT-5-Mini is "gpt-5-mini". Use this ID in your API requests to specify this model.

### Does GPT-5-Mini have a free tier?

Yes, ModelsLab offers a free tier that lets you try GPT-5-Mini and other AI models. Sign up to get free API credits and start building immediately.

---

*This markdown version is optimized for AI agents and LLMs.*

**Links:**
- [Website](https://modelslab.com)
- [API Documentation](https://docs.modelslab.com)
- [Blog](https://modelslab.com/blog)

---
*Generated by ModelsLab - 2026-04-25*