---
title: XAI: Grok 4.5 API | Text Generation | ModelsLab
description: Build with XAI: Grok 4.5 API by X Ai. Text generation, chat, code, and reasoning. Pay-per-use. Free tier.
url: https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/x-ai/x-ai-grok-4.5.md
canonical: https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/x-ai/x-ai-grok-4.5.md
type: product
component: Playground/LLM/Index
generated_at: 2026-07-11T21:07:08.475198Z
---

xAI: Grok 4.5
---

 [LLMs.txt](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/x-ai-grok-4.5/llms.txt) [.md](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/x-ai/x-ai-grok-4.5.md)

xAI: Grok 4.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

### xAI: Grok 4.5

x-ai x-ai-grok-4.5

Copy model ID

PricingInput $2.00 / 1M tokens

Output $6.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-frontend-v2-927501783998.us-east4.run.app/models?feature=llmaster)

[#### open\_router/Z.ai: GLM 4.7 Flash

z-ai-glm-4.7-flash

From $0.23/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/z-ai-glm-4.7-flash)

[#### open\_router/OpenAI: GPT-4

openai-gpt-4

From $45.00/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/openai-gpt-4)

[#### open\_router/Mistral Large

mistralai-mistral-large

From $4.00/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/mistralai-mistral-large)

[#### open\_router/OpenAI: GPT-3.5 Turbo Instruct

openai-gpt-3.5-turbo-instruct

From $1.75/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/openai-gpt-3.5-turbo-instruct)

[#### open\_router/Meta: Llama 3.3 70B Instruct

meta-llama-llama-3.3-70b-instruct

From $0.21/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/meta-llama-llama-3.3-70b-instruct)

[#### qwen/Qwen2-VL (72B) Instruct

Qwen-Qwen2-VL-72B-Instruct

From $1.20/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/qwen/Qwen-Qwen2-VL-72B-Instruct)

[#### open\_router/Qwen: Qwen3.5 Plus 2026-04-20

qwen-qwen3.5-plus-20260420

From $1.05/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3.5-plus-20260420)

[#### perplexity\_ai/R1 1776

perplexity-ai-r1-1776

From $8.40/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/perplexity_ai/perplexity-ai-r1-1776)

[#### open\_router/Z.ai: GLM 4.5V

z-ai-glm-4.5v

From $1.20/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/z-ai-glm-4.5v)

[#### deepseek/DeepSeek-R1

deepseek-ai-DeepSeek-R1-Distill-Llama-70B

From $2.00/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/deepseek/deepseek-ai-DeepSeek-R1-Distill-Llama-70B)

[#### open\_router/Qwen: Qwen3 Coder 30B A3B Instruct

qwen-qwen3-coder-30b-a3b-instruct

From $0.17/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3-coder-30b-a3b-instruct)

[#### open\_router/Mistral: Voxtral Small 24B 2507

mistralai-voxtral-small-24b-2507

From $0.20/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/mistralai-voxtral-small-24b-2507)

[#### open\_router/Qwen: Qwen3 Max

qwen-qwen3-max

From $2.34/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3-max)

[#### open\_router/Mistral: Codestral 2508

mistralai-codestral-2508

From $0.60/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/mistralai-codestral-2508)

[#### open\_router/DeepSeek: R1 Distill Llama 70B

deepseek-deepseek-r1-distill-llama-70b

From $0.80/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/deepseek-deepseek-r1-distill-llama-70b)

[#### open\_router/Google: Nano Banana Pro (Gemini 3 Pro Image Preview)

google-gemini-3-pro-image-preview

From $7.00/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/google-gemini-3-pro-image-preview)

[#### open\_router/DeepSeek: DeepSeek V3.2 Exp

deepseek-deepseek-v3.2-exp

From $0.34/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/deepseek-deepseek-v3.2-exp)

[#### open\_router/Qwen: Qwen3.5-122B-A10B

qwen-qwen3.5-122b-a10b

From $1.17/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3.5-122b-a10b)

Open Source Alternatives
---

Explore open-source models that offer similar capabilities with full transparency and flexibility

 [View all open source models](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models?feature=llm&provider=open-source-models)

[MU

Popular](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/modelslab/uncensored-chat)[ModelsLab](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/modelslab)

 [Modelslab: Uncensored Chat

Open Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/modelslab/uncensored-chat)

About XAI: Grok 4.5
---

XAI: Grok 4.5 is a text generation AI model by X Ai available on ModelsLab. Access XAI: Grok 4.5 through our API with pay-per-use pricing and no minimum commitments.

### Technical Specifications

Model IDx-ai-grok-4.5

CategoryLLM Models

TaskText Generation

Price$4 per million tokens

AddedJuly 8, 2026

### 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 XAI: Grok 4.5 into your application with a single API call. Get your API key from the [pricing page](https://modelslab-frontend-v2-927501783998.us-east4.run.app/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": "x-ai-grok-4.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>
```

### Pricing

XAI: Grok 4.5 API costs $4.000000 per million tokens. Pay only for what you use with no minimum commitments. [View pricing plans](https://modelslab-frontend-v2-927501783998.us-east4.run.app/pricing)

### Use Cases

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

[Browse LLM Models](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models?feature=llmaster) [More from X Ai](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router) [View Pricing](https://modelslab-frontend-v2-927501783998.us-east4.run.app/pricing)

XAI: Grok 4.5 FAQ
---

### What is XAI: Grok 4.5?

XAI: Grok 4.5 is a text generation AI model by X Ai available on ModelsLab. Access it through our API with pay-per-use pricing and no minimum commitments.

### How do I use the XAI: Grok 4.5 API?

You can integrate XAI: Grok 4.5 into your application with a single API call. Sign up on ModelsLab to get your API key, then use the model ID "x-ai-grok-4.5" in your API requests. We provide SDKs for Python, JavaScript, and cURL examples in the API documentation.

### How much does XAI: Grok 4.5 cost?

XAI: Grok 4.5 costs $4.000000 per million tokens. ModelsLab uses pay-per-use pricing with no minimum commitments. A free tier is available to get started.

### What is the XAI: Grok 4.5 model ID?

The model ID for XAI: Grok 4.5 is "x-ai-grok-4.5". Use this ID in your API requests to specify this model.

### Does XAI: Grok 4.5 have a free tier?

Yes, ModelsLab offers a free tier that lets you try XAI: Grok 4.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-07-12*