Circuit
Code
Versions
API
RUNNING
The circuit is running and is healthy.
0Total Runs
0Avg Response Time
-Avg Tokens per Second
0Avg Spend per Run
-Input Cache Hit Rate
0.00%Error Rate
Control Panel
Login to ModelWorksLogin to ModelWorks to use this circuit. To get started, get an API key.
Explore endpointsModelWorks allows apps to access LLMs and MCP servers worldwide easily in any datacenter, securely and privately.
SecretsOverride default secrets and set up your own for better billing and security.
Circuit Card
xAI GROK Chat Completion Service
Overview
The xAI GROK Chat Completion Service generates AI-driven chat completions using the GROK API. Grok is xAI's flagship AI model with industry-leading capabilities in reasoning, tool calling, and instruction following.
Available Models
| Model | Description | Context | Pricing (per 1M tokens) |
|---|---|---|---|
| grok-4.3 | Latest flagship model with reasoning capabilities | 1M tokens | Input: $1.25 / Output: $2.50 |
| grok-4-1-fast-reasoning | Fast reasoning model with document support | 1M tokens | Input: $0.20 / Output: $0.50 |
Grok 4.3
Key Features
- Reasoning: Configurable reasoning effort (none/low/medium/high) with separate reasoning output
- Function Calling: Full support for tools and parallel tool calls
- Built-in Tools: Real-time web search and X search
- Image Understanding: Process images via attachments
- 1M Context Window: Handle large conversations and documents
Parameters
Required
| Parameter | Type | Description |
|---|---|---|
messages | array | Conversation messages |
Optional
| Parameter | Type | Description |
|---|---|---|
reasoning_effort | string | Reasoning depth: none, low, medium, high |
max_output_tokens | number | Maximum tokens to generate (includes reasoning tokens) |
temperature | number | Sampling temperature (0-2) |
top_p | number | Nucleus sampling value |
tools | array | Tool definitions (built-in: web_search, x_search, code_interpreter) |
tool_choice | string | Tool usage: auto, none, or function name |
parallel_tool_calls | boolean | Allow parallel tool calls |
attachment | blob | Image attachment (blob ID or URL) |
user | string | End-user identifier for abuse monitoring |
Outputs
| Output | Description |
|---|---|
chat_completion_output | The generated response text |
chat_reasoning_output | The reasoning trace (when reasoning enabled) |
chat_completion_tool_calls | Tool calls made by the model |
chat_completion_finish_reason | Completion reason: stop, tool_calls, etc. |
Example Requests
Basic Chat
{
"input": {
"messages": [
{ "role": "user", "content": "What is 2+2?" }
],
"reasoning_effort": "low",
"max_output_tokens": 500
}
}
With Web Search
{
"input": {
"messages": [
{ "role": "user", "content": "What are the latest AI news today?" }
],
"tools": [
{"type": "web_search"},
{"type": "x_search"}
]
}
}
With Custom Function
{
"input": {
"messages": [
{ "role": "user", "content": "Get the weather for San Francisco" }
],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": { "type": "string" }
},
"required": ["location"]
}
}
}
],
"tool_choice": "auto"
}
}
Built-in Tools
| Tool | Description |
|---|---|
web_search | Search the web for real-time information |
x_search | Search X (Twitter) posts, users, threads |
code_interpreter | Execute Python code in sandbox |
The model automatically decides when to use these tools and returns citations in the response.
Cost
Token-based pricing (Grok 4.3): $1.25 per 1M input tokens, $2.50 per 1M output tokens.
Setup
- Configure your
grok_api_keyin your environment secrets - Use the model via the chat completion endpoint
Notes
- Use
reasoning_effortto control thinking depth - higher values use more tokens but provide better analysis - Enable
web_searchorx_searchin thetoolsarray for real-time data - Pass image blob IDs or URLs via the
attachmentparameter for image processing
Enjoy dynamic chat completions with xAI GROK!
About
The xAI GROK Chat Completion Service is designed to generate AI-driven chat completions using the GROK API.
About the Author
xAI is an artificial intelligence research company founded by Elon Musk in July 2023, created with the mission to "understand the true nature of the universe" through advanced AI development. The company's flagship product is Grok, a family of large language models designed to compete directly with OpenAI's GPT and Anthropic's Claude. Grok models are deeply integrated with X (formerly Twitter), giving them unique access to real-time social media data and allowing them to provide up-to-date information on
Additional Information
Pricing Structure
The cost model for running this circuit. Charges may be fixed per execution or based on token usage.
Token-based Pricing
UsageLocal
Input tokens0.0₃125 credits
Output tokens0.0₃25 credits
Token pricing display: Per TokenPer Token