Call Grok 4.3, 4.5, and 4.6 with OpenAI-compatible clients through RunAPI.
Model Reference | Skill Repo | All Models
Configure the official OpenAI SDK or any compatible client with
https://runapi.ai/v1, send an exact Grok model id, and use one RunAPI balance
for chat, Responses, reasoning, tools, structured output, and streaming. Grok
4.6 is available through Responses; Grok 4.3 and 4.5 retain their existing
compatibility interfaces. This skill teaches Claude Code, Codex, Gemini CLI,
Cursor, and 50+ agents how to wire Grok requests through RunAPI.
The canonical agent file is skills/grok/SKILL.md.
npx skills add runapi-ai/grok -gOr paste this prompt to your AI agent:
Install the grok skill for me:
1. Clone https://github.com/runapi-ai/grok
2. Copy the skills/grok/ directory into your
user-level skills directory (e.g. ~/.claude/skills/
for Claude Code, ~/.codex/skills/ for Codex).
3. Verify that SKILL.md is present.
4. Confirm the install path when done.
from openai import OpenAI
client = OpenAI(
api_key="YOUR_RUNAPI_TOKEN",
base_url="https://runapi.ai/v1",
)
response = client.chat.completions.create(
model="grok-4.5",
messages=[{"role": "user", "content": "Review this rollout plan."}],
reasoning_effort="high",
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: "YOUR_RUNAPI_TOKEN",
baseURL: "https://runapi.ai/v1",
});
const response = await client.chat.completions.create({
model: "grok-4.5",
messages: [{ role: "user", content: "Review this rollout plan." }],
reasoning_effort: "high",
});
console.log(response.choices[0].message.content);This Grok 4.6 Responses example uses structured input and requests strict JSON.
No additional test field is part of the RunAPI request contract:
response = client.responses.create(
model="grok-4.6",
input=[{
"role": "user",
"content": [{
"type": "input_text",
"text": "Return the highest rollout risk and its severity.",
}],
}],
stream=False,
reasoning={"effort": "xhigh"},
text={
"format": {
"type": "json_schema",
"name": "rollout_risk",
"strict": True,
"schema": {
"type": "object",
"properties": {
"risk": {"type": "string"},
"severity": {"type": "string", "enum": ["low", "medium", "high"]},
},
"required": ["risk", "severity"],
"additionalProperties": False,
},
}
},
)
print(response.output_text)
print(response.usage)Grok 4.6 is available through RunAPI's OpenAI-compatible Responses interface.
Grok 4.3 and 4.5 remain available through Chat Completions, Responses,
Anthropic-compatible Messages, and Gemini contents. Use the exact protocol
supported by the selected model.
Get a RunAPI API Key at https://runapi.ai/api_keys.
| Model ID | Notes |
|---|---|
grok-4.20-0309-non-reasoning |
— |
grok-4.6 |
Responses, image input, four reasoning levels, function tools, and structured output |
grok-4.5 |
Chat, coding, reasoning, tools, and structured output |
grok-4.3 |
Reasoning, Responses, function tools, and structured output |
- Grok API on RunAPI: https://runapi.ai/models/grok
- Provider page: https://runapi.ai/providers/xai
- Browse all models: https://runapi.ai/models
- Keep API keys in
OPENAI_API_KEYor a secret manager. - Use the exact model id
grok-4.3,grok-4.5, orgrok-4.6. - Add
input_imagewith a publicimage_urlfor Grok 4.6 image understanding. - Only
functiontools are supported for Grok 4.6. Hosted tools such asweb_search,x_search,file_search,code_interpreter,image_generation, andmcpare rejected before execution. - Do not send
input_fileor state fields such asprevious_response_idfor Grok 4.6. - For Responses streams, wait for
response.completed, terminalusage, and[DONE]. - Link to the matching catalog variant page for pricing: https://runapi.ai/models/grok/4.3, https://runapi.ai/models/grok/4.5, or https://runapi.ai/models/grok/4.6.
Licensed under the Apache License, Version 2.0.