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

xAI: Grok Latest
---

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

[#### nvidia/NVIDIA: Nemotron 3 Super

nvidia-nemotron-3-super-120b-a12b

From $0.33/M tokens](https://modelslab.com/models/nvidia/nvidia-nemotron-3-super-120b-a12b)

[#### poolside/Poolside: Laguna XS 2.1

poolside-laguna-xs-2.1

From $0.09/M tokens](https://modelslab.com/models/poolside/poolside-laguna-xs-2.1)

[#### xiaomi/Xiaomi: MiMo-V2.5-Pro

xiaomi-mimo-v2.5-pro

From $0.65/M tokens](https://modelslab.com/models/xiaomi/xiaomi-mimo-v2.5-pro)

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

[#### openai/gpt-oss-20b

gpt-oss-20b

From $0.08/M tokens](https://modelslab.com/models/openai/gpt-oss-20b)

[#### thedrummer/TheDrummer: Rocinante 12B

thedrummer-rocinante-12b

From $0.38/M tokens](https://modelslab.com/models/thedrummer/thedrummer-rocinante-12b)

[#### qwen/Qwen: Qwen-Plus

qwen-qwen-plus

From $0.52/M tokens](https://modelslab.com/models/qwen/qwen-qwen-plus)

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

morph-morph-v3-large

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

[#### openai/GPT 5.1

gpt5.1

From $5.63/M tokens](https://modelslab.com/models/openai/gpt5.1)

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

cohere-command-r-plus-08-2024

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

[#### openai/OpenAI GPT-OSS 120B

openai-gpt-oss-120b

From $0.10/M tokens](https://modelslab.com/models/openai/openai-gpt-oss-120b)

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

mistralai-ministral-3b-2512

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

[#### nex-agi/Nex AGI: Nex-N2-Pro

nex-agi-nex-n2-pro

From $0.63/M tokens](https://modelslab.com/models/nex-agi/nex-agi-nex-n2-pro)

[#### qwen/Qwen: Qwen3.5-Flash

qwen-qwen3.5-flash-02-23

From $0.16/M tokens](https://modelslab.com/models/qwen/qwen-qwen3.5-flash-02-23)

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

openai-gpt-5.4

From $8.75/M tokens](https://modelslab.com/models/openai/openai-gpt-5.4)

[#### amazon/Amazon: Nova Pro 1.0

amazon-nova-pro-v1

From $2.00/M tokens](https://modelslab.com/models/amazon/amazon-nova-pro-v1)

[#### meta/Meta: Llama Guard 4 12B

meta-llama-llama-guard-4-12b

From $0.18/M tokens](https://modelslab.com/models/meta/meta-llama-llama-guard-4-12b)

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

qwen-qwen3-vl-30b-a3b-instruct

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

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 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.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-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.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 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-19*