---
title: GPT 5 API | Text Generation | ModelsLab
description: Multimodal large language model with up to 272,000 token input, 128,000 token output, adaptive reasoning levels, real-time model routing, and advanced.
url: https://modelslab.com/models/openai/gpt-5/api.md
canonical: https://modelslab.com/models/openai/gpt-5/api.md
type: product
component: Playground/LLM/Index
generated_at: 2026-04-24T23:26:57.515079Z
---

GPT-5
---

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

gpt-5 openai Closed Source Model $5.625000 / call

GPT-5
---

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

openai gpt-5

Copy model ID

PricingInput $1.25 / 1M tokens

Output $10.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)

[Q3](https://modelslab.com/models/together_ai/Qwen-Qwen3-30B-A3B)[Together AI](https://modelslab.com/models/together_ai)

 [Qwen3 30B A3b

Closed Source Model](https://modelslab.com/models/together_ai/Qwen-Qwen3-30B-A3B)

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

 [OpenAI: GPT-5.4 Pro

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

[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)

[AN](https://modelslab.com/models/open_router/amazon-nova-premier-v1)[Open Router](https://modelslab.com/models/open_router)

 [Amazon: Nova Premier 1.0

Closed Source Model](https://modelslab.com/models/open_router/amazon-nova-premier-v1)

[BS](https://modelslab.com/models/open_router/bytedance-seed-seed-1.6-flash)[Open Router](https://modelslab.com/models/open_router)

 [ByteDance Seed: Seed 1.6 Flash

Closed Source Model](https://modelslab.com/models/open_router/bytedance-seed-seed-1.6-flash)

[QQ](https://modelslab.com/models/open_router/qwen-qwen3-32b)[Open Router](https://modelslab.com/models/open_router)

 [Qwen: Qwen3 32B

Closed Source Model](https://modelslab.com/models/open_router/qwen-qwen3-32b)

[QQ](https://modelslab.com/models/open_router/qwen-qwen3-coder)[Open Router](https://modelslab.com/models/open_router)

 [Qwen: Qwen3 Coder 480B A35B

Closed Source Model](https://modelslab.com/models/open_router/qwen-qwen3-coder)

[DR](https://modelslab.com/models/open_router/deepseek-deepseek-r1-distill-llama-70b)[Open Router](https://modelslab.com/models/open_router)

 [DeepSeek: R1 Distill Llama 70B

Closed Source Model](https://modelslab.com/models/open_router/deepseek-deepseek-r1-distill-llama-70b)

[GN](https://modelslab.com/models/open_router/google-gemini-3-pro-image-preview)[Open Router](https://modelslab.com/models/open_router)

 [Google: Nano Banana Pro (Gemini 3 Pro Image Preview)

Closed Source Model](https://modelslab.com/models/open_router/google-gemini-3-pro-image-preview)

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

 [OpenAI: GPT-5.2-Codex

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

[Q7](https://modelslab.com/models/together_ai/Qwen-Qwen2.5-7B-Instruct-Turbo)[Together AI](https://modelslab.com/models/together_ai)

 [Qwen2.5 7B Instruct Turbo

Closed Source Model](https://modelslab.com/models/together_ai/Qwen-Qwen2.5-7B-Instruct-Turbo)

[![Meta: Llama 3 8B Instruct](https://images.stablediffusionapi.com/?Image=https://assets.modelslab.ai/generations/07cb8c22-a068-40f8-a2e8-57d8b2371261.png)](https://modelslab.com/models/open_router/meta-llama-llama-3-8b-instruct)[Open Router](https://modelslab.com/models/open_router)

 [Meta: Llama 3 8B Instruct

Closed Source Model](https://modelslab.com/models/open_router/meta-llama-llama-3-8b-instruct)

[ML](https://modelslab.com/models/together_ai/meta-llama-Llama-3-8b-chat-hf)[Together AI](https://modelslab.com/models/together_ai)

 [Meta Llama 3 8B Instruct Reference

Closed Source Model](https://modelslab.com/models/together_ai/meta-llama-Llama-3-8b-chat-hf)

[OO](https://modelslab.com/models/open_router/openai-o3)[Open Router](https://modelslab.com/models/open_router)

 [OpenAI: o3

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

[NH](https://modelslab.com/models/open_router/nousresearch-hermes-3-llama-3.1-405b)[Open Router](https://modelslab.com/models/open_router)

 [Nous: Hermes 3 405B Instruct

Closed Source Model](https://modelslab.com/models/open_router/nousresearch-hermes-3-llama-3.1-405b)

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

 [Deepseek V3 Base

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

[OG](https://modelslab.com/models/open_router/openai-gpt-4-1106-preview)[Open Router](https://modelslab.com/models/open_router)

 [OpenAI: GPT-4 Turbo (older v1106)

Closed Source Model](https://modelslab.com/models/open_router/openai-gpt-4-1106-preview)

[G4](https://modelslab.com/models/together_ai/google-gemma-4-31B-it)[Together AI](https://modelslab.com/models/together_ai)

 [Gemma 4 31B-it FP8

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

About GPT-5
---

GPT-5 is the most capable model in the GPT-5 family, built for advanced reasoning, complex coding, and creative tasks.

### Technical Specifications

Model IDgpt-5CategoryLLM ModelsTaskText GenerationPrice$5.625000 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 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",
        "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/api) for SDKs, code examples in Python, JavaScript, and more.

### Pricing

GPT-5 API costs $5.625000 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](https://modelslab.com/gpt-5) [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 FAQ
---

### What is GPT-5?

GPT-5 is the most capable model in the GPT-5 family, built for advanced reasoning, complex coding, and creative tasks.

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

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

### How much does GPT-5 cost?

GPT-5 costs $5.625000 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 model ID?

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

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

Yes, ModelsLab offers a free tier that lets you try GPT-5 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*