---
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.com/models/x-ai/x-ai-grok-4.5.md
canonical: https://modelslab.com/models/x-ai/x-ai-grok-4.5
type: product
component: Playground/LLM/Index
generated_at: 2026-07-19T10:15:12.668106Z
---

xAI: Grok 4.5
---

 [LLMs.txt](https://modelslab.com/models/x-ai/x-ai-grok-4.5/llms.txt) [.md](https://modelslab.com/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.com/models?feature=llmaster)

[#### mistralai/Mistral (7B) Instruct v0.3

mistralai-Mistral-7B-Instruct-v0.3

From $0.20/M tokens](https://modelslab.com/models/mistralai/mistralai-Mistral-7B-Instruct-v0.3)

[#### anthropic/Anthropic Claude Haiku Latest

anthropic-claude-haiku-latest

From $3.00/M tokens](https://modelslab.com/models/anthropic/anthropic-claude-haiku-latest)

[#### scb10x/Typhoon 2 70B Instruct

scb10x-scb10x-llama3-1-typhoon2-70b-instruct

From $1.06/M tokens](https://modelslab.com/models/scb10x/scb10x-scb10x-llama3-1-typhoon2-70b-instruct)

[#### meta/Meta Llama 3.1 8B Instruct Turbo

meta-llama-Meta-Llama-3.1-8B-Instruct-Turbo

From $0.18/M tokens](https://modelslab.com/models/meta/meta-llama-Meta-Llama-3.1-8B-Instruct-Turbo)

[#### z-ai/Z.ai: GLM 5

z-ai-glm-5

From $2.05/M tokens](https://modelslab.com/models/z-ai/z-ai-glm-5)

[#### google/Google: Gemini 2.5 Pro Preview 05-06

google-gemini-2.5-pro-preview-05-06

From $5.63/M tokens](https://modelslab.com/models/google/google-gemini-2.5-pro-preview-05-06)

[#### qwen/Qwen: Qwen3 30B A3B

qwen-qwen3-30b-a3b

From $0.33/M tokens](https://modelslab.com/models/qwen/qwen-qwen3-30b-a3b)

[#### google/Gemini 2.0 Flash

gemini-2.0-flash-001

From $0.25/M tokens](https://modelslab.com/models/google/gemini-2.0-flash-001)

[#### google/Google: Gemini 3.1 Pro Preview Custom Tools

google-gemini-3.1-pro-preview-customtools

From $7.00/M tokens](https://modelslab.com/models/google/google-gemini-3.1-pro-preview-customtools)

[#### nousresearch/Nous: Hermes 4 405B

nousresearch-hermes-4-405b

From $2.00/M tokens](https://modelslab.com/models/nousresearch/nousresearch-hermes-4-405b)

[#### cohere/Cohere: Command R7B (12-2024)

cohere-command-r7b-12-2024

From $0.09/M tokens](https://modelslab.com/models/cohere/cohere-command-r7b-12-2024)

[#### google/Gemma-2 Instruct (27B)

google-gemma-2-27b-it

From $0.65/M tokens](https://modelslab.com/models/google/google-gemma-2-27b-it)

[#### morph/Morph: Morph V3 Large

morph-morph-v3-large

From $1.40/M tokens](https://modelslab.com/models/morph/morph-morph-v3-large)

[#### meta/Meta: Llama 3.3 70B Instruct

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

From $0.21/M tokens](https://modelslab.com/models/meta/meta-llama-llama-3.3-70b-instruct)

[#### cohere/Cohere: Command R (08-2024)

cohere-command-r-08-2024

From $0.38/M tokens](https://modelslab.com/models/cohere/cohere-command-r-08-2024)

[#### marin/Marin 8B Instruct

marin-community-marin-8b-instruct

From $0.22/M tokens](https://modelslab.com/models/marin/marin-community-marin-8b-instruct)

[#### qwen/Qwen: Qwen3.6 35B A3B

qwen-qwen3.6-35b-a3b

From $0.57/M tokens](https://modelslab.com/models/qwen/qwen-qwen3.6-35b-a3b)

[#### mistralai/Mistral: Ministral 3 8B 2512

mistralai-ministral-8b-2512

From $0.15/M tokens](https://modelslab.com/models/mistralai/mistralai-ministral-8b-2512)

Open Source Alternatives
---

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

 [View all open source models](https://modelslab.com/models?feature=llm&provider=open-source-models)

[MU

Popular](https://modelslab.com/models/modelslab/uncensored-chat)[ModelsLab](https://modelslab.com/models/modelslab)

 [Modelslab: Uncensored Chat

Open Source Model](https://modelslab.com/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.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": "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.com/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.com/models?feature=llmaster) [More from X Ai](https://modelslab.com/models/open_router) [View Pricing](https://modelslab.com/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-19*