Grok MCP
Call Grok's dialogue and video generation capabilities in the AI Agent through MCP.
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.
Full access to the entire xAI Grok model series, covering reasoning, conversation, and visual understanding.
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.
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.
Fully compatible with the /v1/chat/completions interface. Call Grok with the OpenAI SDK without modifying your code.
Use the OpenAI SDK you already know and seamlessly switch to Grok models by simply changing the base_url.
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)
From registration to completing your first Grok conversation, it only takes a few minutes.
Register and generate an API key from the console.
Choose a model such as Grok 4 or Grok 3 based on your needs.
Send requests through the OpenAI-compatible /v1/chat/completions.
Covering a wide range of use cases, from everyday conversations to professional research.
Grok 4 excels in programming benchmarks, efficiently generating and debugging code.
Handle complex data analysis tasks and generate insight reports and visualization recommendations.
Build customer service systems with Grok 3 to quickly respond to customer questions.
Text-based creative work such as article writing, translation, summarization, and advertising copy.
Complex reasoning, literature analysis, mathematical proofs, and scientific exploration.
From ultra-fast reasoning to flagship reasoning, choose the model that suits you best
A new-generation flagship reasoning model that supports long context, visual understanding, and tool calling.
A mature high-performance model suitable for general reasoning, programming, and content tasks.
Pay by Token usage, with no subscription fees or hidden charges.
Bulk packages offer additional discounts
Billed based on actual Token usage, with separate pricing for input and output
Dedicated solutions for high-volume teams
Common questions about using the Grok API
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.
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.
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.
Yes. Set stream: true to receive token-by-token SSE streaming output, suitable for real-time conversations and frontend display scenarios.
Ace Data Cloud offers a variety of large language model APIs
Access the full xAI Grok model lineup through an OpenAI-compatible interface and empower your AI applications.