xai-api
Skill0 starsChanged 26 days agoMITView on GitHub
Grok API and Grok Build CLI reference." # 39 chars — safe
- Reads credentials
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 52
Use skill_view(name='xai-api', file_path='references/<file>') to load a chapter when needed:
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
xAI / Grok API & Grok Build CLI
Reference skill covering the xAI Grok API (https://api.x.ai/v1) and the Grok Build CLI (grok binary). Use it when working with Grok models, the Responses API, server-side tools, or when delegating coding to the grok headless CLI. Source: https://docs.x.ai — every page is also available as markdown by appending .md to the URL (e.g. https://docs.x.ai/developers/models.md).
When to Use
- Choosing a Grok model or checking pricing for a specific model.
- Calling the xAI REST API (Responses, Chat Completions, Images, Voice).
- Using server-side tools: function calling, web search, X search, code execution, structured outputs.
- Driving the
grokCLI headlessly for coding tasks (delegation pattern). - Configuring OmniRoute / custom providers with xAI models.
- Checking rate limits or prompt caching behaviour.
Quick Reference
| What | Where |
| Models + pricing | references/models-pricing.md |
| Responses API | references/responses-api.md |
| Function calling + tools | references/tools.md |
| Structured outputs | references/structured-outputs.md |
| Rate limits + tiers | references/rate-limits.md |
| Grok Build CLI (headless) | references/grok-build-cli.md |
| Grok Build features (sessions, worktrees, permissions) | references/grok-build-features.md |
Key Facts (always in context)
- Base URL:
https://api.x.ai/v1. Auth:Authorization: Bearer $XAI_API_KEY. - Flagship model:
grok-4.6(500k context, $2.00/$6.00 per 1M in/out tokens <200k prompt). - Grok Build model:
grok-build-0.1(256k context, $1.00/$2.00 per 1M tokens <200k prompt). - The Grok CLI binary is
grok(installed at~/.local/bin/grok, config at~/.grok/). - Headless coding:
grok -p "<brief>" --output-format json --always-approve— the-pflag DOES exist (verified in docs); earlier local--helpoutput was misleading. - OmniRoute proxies xAI models via
base_url: http://localhost:7777/v1.
Load on demand
Use skill_view(name='xai-api', file_path='references/<file>') to load a chapter when needed:
references/models-pricing.md— full model table, pricing tiers, model aliases, context limits.references/responses-api.md— POST /v1/responses request body fields, response shape, conversation continuation.references/tools.md— function calling, web search, X search, code execution, collections search, remote MCP; tool pricing.references/structured-outputs.md— JSON schema support, response_format, Pydantic/Zod usage, constraint limits.references/rate-limits.md— tier thresholds, per-model RPS/TPM tables, 429 handling.references/grok-build-cli.md—groksubcommands, headless flags, ACP, session management.references/grok-build-features.md— sessions, worktrees, permissions, sandbox, subagents, hooks, MCP servers.
Pitfalls
logprobs/top_logprobsare silently ignored ongrok-4.20+ models.- Long-context pricing: requests with ≥200k prompt tokens are billed at the higher rate for ALL tokens, not just the overflow.
allowed_domainsandexcluded_domainscannot be set together in one Web Search request.max_output_tokensdefaults to 128,000 — set it explicitly for long generations.previous_response_id+instructionsare mutually exclusive; the previous response's system prompt is used instead.- Batch API: not all models support it; check each model page.
groksessions live in~/.grok/sessions/; worktrees in~/.grok/worktrees/and persist after the session ends.
In this repository172 other files it gives its agents.
- AGENTS.mdAGENTS.md
- aes-agentSkill
- aes-capabilitiesSkill
- aes-contractSkill
- aes-docsSkill
- aes-lint-arwakySkill
- aes-migrationSkill
- aes-rootSkill
- aes-surfaceSkill
- aes-taxonomySkill
- aes-testing-suiteSkill
- aes-utilitySkill
- build-with-aiSkill
- omni-model-inventorySkill
- omnirouteSkill
- android-emulator-linux-gpsSkill
- chromium-profile-provisioningSkill
- computer-useSkill
- flatpak-chromium-automationSkill
- qwen-web-arwaky-devSkill
- qwen-webSkill
- cleanup-consolidateSkill
- codacy-analysis-cliSkill
- codacy-cloud-cliSkill
- codacy-code-reviewSkill
- codebase-inspectionSkill
- coderabbit-reviewSkill
- code-reviewSkill
- configure-codacy-cloudSkill
- configure-codacySkill
- fix-bypassSkill
- fix-markdown-inline-htmlSkill
- fixture-dir-pruningSkill
- harness-source-auditSkill
- no-mistakesSkill
- report-linter-false-positiveSkill
- reviewSkill
- setup-coverageSkill
- strict-code-quality-reviewSkill
- architecture-diagramSkill
- ascii-artSkill
- ascii-videoSkill
- baoyu-infographicSkill
- blender-arwakySkill
- claude-designSkill
- comfyuiSkill
- design-mdSkill
- excalidrawSkill
- game-assetsSkill
- gif-searchSkill
- imagineSkill
- manim-videoSkill
- p5jsSkill
- popular-web-designsSkill
- pretextSkill
- psd-overlay-verificationSkill
- psd-timelapse-workflowSkill
- sketchSkill
- songseeSkill
- songwriting-and-ai-musicSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

