xAI · Large Language Model

Grok AI Chat API

Access xAI's Grok model series through the OpenAI-compatible format. Supports Grok 4 flagship reasoning and Grok 3 ultra-long context—billed by Token.

🧠 Grok 4 Flagship Reasoning 📜 Grok 3 Ultra-Long Context 🔌 OpenAI Compatible
5
Grok Models Available
131K
Context Window
Token
Usage-Based Billing
∞
No Rate Limits

Core Features

Full access to the entire xAI Grok model series, covering reasoning, conversation, and visual understanding.

🧠

Flagship Reasoning Capabilities

Grok 4 is xAI's most powerful reasoning model, delivering exceptional performance in mathematics, programming, and complex analytical tasks, with support for deep-thinking reasoning chains.

📜

Ultra-Long Context

Grok 3 provides an ultra-long context window of up to 1M, enabling one-time processing of large inputs such as entire financial reports, lengthy documents, and judicial case files.

🔌

OpenAI-Compatible Format

Fully compatible with the /v1/chat/completions interface. Call Grok with the OpenAI SDK without modifying your code.

OpenAI Compatible, Ready to Use

Use the OpenAI SDK you already know and seamlessly switch to Grok models by simply changing the base_url.

Python
from openai import OpenAI
client = OpenAI(
    base_url="https://api.acedata.cloud/v1",
    api_key="YOUR_API_KEY"
)
response = client.chat.completions.create(
    model="grok-4",
    messages=[
        {"role": "user", "content": "解释量子计算的基本原理"}
    ]
)
print(response.choices[0].message.content)

Get Started Quickly in 3 Steps

From registration to completing your first Grok conversation, it only takes a few minutes.

1

Get an API Key

Register and generate an API key from the console.

2

Choose a Grok Model

Choose a model such as Grok 4 or Grok 3 based on your needs.

3

Start a Conversation

Send requests through the OpenAI-compatible /v1/chat/completions.

What Is Grok Suitable For?

Covering a wide range of use cases, from everyday conversations to professional research.

💻

Code Generation

Grok 4 excels in programming benchmarks, efficiently generating and debugging code.

📊

Data Analysis

Handle complex data analysis tasks and generate insight reports and visualization recommendations.

🤖

AI Customer Service

Build customer service systems with Grok 3 to quickly respond to customer questions.

📝

Content Creation

Text-based creative work such as article writing, translation, summarization, and advertising copy.

🔬

Academic Research

Complex reasoning, literature analysis, mathematical proofs, and scientific exploration.

Grok Model Series

From ultra-fast reasoning to flagship reasoning, choose the model that suits you best

🧠 Grok 4.7

A new-generation flagship reasoning model that supports long context, visual understanding, and tool calling.

grok-4.7

🔥 Grok 4.5 / 4

A mature high-performance model suitable for general reasoning, programming, and content tasks.

grok-4.5 grok-4

Grok API Pricing

Pay by Token usage, with no subscription fees or hidden charges.

Bulk packages offer additional discounts

Pay as You Go
Token Billing
Low Cost billed by Token

Billed based on actual Token usage, with separate pricing for input and output

  • ✓ Grok 4.7: Next-generation reasoning flagship
  • ✓ Grok 3: A cost-effective choice with ultra-long context
  • ✓ Streaming — free
View Pricing Details
Enterprise
Custom

Dedicated solutions for high-volume teams

  • ✓ Volume-based tiered discounts
  • ✓ Priority support and account manager
  • ✓ Custom rate limits
  • ✓ SLA guarantee
  • ✓ Private deployment solutions
Contact Sales

Frequently Asked Questions

Common questions about using the Grok API

What is the difference between Grok 4 and Grok 3?›

Grok 4 is xAI's flagship reasoning model, delivering the best performance on complex tasks. Grok 3 is the previous-generation flagship, with an ultra-long context window of up to 1M, making it suitable for long-document analysis and more cost-effective. The choice depends on whether you prioritize reasoning capability or context length and cost.

What is the difference from using the xAI API directly?›

Ace Data Cloud provides a unified OpenAI-compatible interface, with no need to register an xAI account or configure a separate API key. Use the same API Key to access models from Grok, Claude, GPT, Gemini, and more.

Can I use the OpenAI SDK to call Grok?›

Yes. The Grok API is fully compatible with OpenAI's /v1/chat/completions format; simply change the base_url and model parameters. OpenAI SDKs for Python, Node.js, Go, and other languages are supported.

Is streaming output supported?›

Yes. Set stream: true to receive token-by-token SSE streaming output, suitable for real-time conversations and frontend display scenarios.

Explore More AI Conversation Services

Ace Data Cloud offers a variety of large language model APIs

Start Using the Grok API Now

Access the full xAI Grok model lineup through an OpenAI-compatible interface and empower your AI applications.