---
title: XAI: Grok Latest API | Text Generation | ModelsLab
description: Build with XAI: Grok Latest 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-latest.md
canonical: https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/x-ai/x-ai-grok-latest.md
type: product
component: Playground/LLM/Index
generated_at: 2026-07-11T21:07:08.090085Z
---

xAI: Grok Latest
---

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

xAI: Grok Latest
---

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 Latest

x-ai x-ai-grok-latest

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/ByteDance: UI-TARS 7B 

bytedance-ui-tars-1.5-7b

From $0.15/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/bytedance-ui-tars-1.5-7b)

[#### open\_router/Google: Gemini 3.1 Pro Preview

google-gemini-3.1-pro-preview

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

[#### open\_router/Qwen: Qwen3 VL 30B A3B Thinking

qwen-qwen3-vl-30b-a3b-thinking

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

[#### open\_router/Google: Gemma 4 26B A4B 

google-gemma-4-26b-a4b-it

From $0.20/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/google-gemma-4-26b-a4b-it)

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

z-ai-glm-4.6v

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

[#### open\_router/MiniMax: MiniMax M2.5

minimax-minimax-m2.5

From $0.53/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/minimax-minimax-m2.5)

[#### google/Gemini 2.0 Flash

gemini-2.0-flash-001

From $0.25/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/google/gemini-2.0-flash-001)

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

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

From $3.50/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/meta/meta-llama-Meta-Llama-3.1-405B-Instruct-Turbo)

[#### openai/OpenAI: GPT-5.4

openai-gpt-5.4

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

[#### open\_router/Kwaipilot: KAT-Coder-Pro V2

kwaipilot-kat-coder-pro-v2

From $0.75/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/kwaipilot-kat-coder-pro-v2)

[#### open\_router/Relace: Relace Search

relace-relace-search

From $2.00/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/relace-relace-search)

[#### open\_router/Qwen2.5 72B Instruct

qwen-qwen-2.5-72b-instruct

From $0.38/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen-2.5-72b-instruct)

[#### open\_router/Z.ai: GLM 5.2

z-ai-glm-5.2

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

[#### openai/GPT 5.2

gpt-5.2

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

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

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

From $1.06/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/scb10x/scb10x-scb10x-llama3-1-typhoon2-70b-instruct)

[#### alibaba\_cloud/Qwen: Qwen3.5 397B A17B

qwen-qwen3.5-397b-a17b

From $2.10/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/alibaba_cloud/qwen-qwen3.5-397b-a17b)

[#### open\_router/Anthropic: Claude Opus 4.8 (Fast)

anthropic-claude-opus-4.8-fast

From $30.00/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/anthropic-claude-opus-4.8-fast)

[#### open\_router/Cohere: North Mini Code (free)

cohere-north-mini-code-free

Free](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/cohere-north-mini-code-free)

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 Latest
---

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

### Technical Specifications

Model IDx-ai-grok-latest

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 Latest 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-latest",
        "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 Latest 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 Latest FAQ
---

### What is XAI: Grok Latest?

XAI: Grok Latest 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 Latest API?

You can integrate XAI: Grok Latest 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-latest" in your API requests. We provide SDKs for Python, JavaScript, and cURL examples in the API documentation.

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

XAI: Grok Latest 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 Latest model ID?

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

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

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