bxc-grok-xai

bxc-grok-xai is a skill for Claude Code, Codex from aphrody-code/bxc. It costs 108 tokens per session (825 once invoked), scanned A, original, Apache-2.0.

A high-level client for xAI's Grok models, with a stateful chat interface and support for streaming, structured responses, reasoning settings, and tool calls. It can also use X-specific tools and several authentication methods.

In plain words
What is it for?
Use it to build Bun applications that call Grok, request structured output, stream responses, use tools, or authenticate with an API key or supported Grok login.
Why use it?
It avoids repeatedly building the lower-level code needed to manage chat state, streamed responses, authentication, and tool-call loops.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Part of the bxc plugin — 22 skills, 3 commands shipped together

Good fit Use it to build Bun applications that call Grok, request structured output…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aphrody-code/bxc/bxc-grok-xai
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add aphrody-code/bxc --skill bxc-grok-xai
Clone the repo
git clone --depth 1 https://github.com/aphrody-code/bxc

Made for: Claude Code, Codex.

Or install bxc, the plugin that ships this one along with the rest of its 22 skills, 3 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bxc-grok-xai

README.md
[![agentmods](https://agentmods.dev/badge/skills/aphrody-code/bxc/bxc-grok-xai.svg)](https://agentmods.dev/skills/aphrody-code/bxc/bxc-grok-xai)
Your own site
<a href="https://agentmods.dev/skills/aphrody-code/bxc/bxc-grok-xai"><img src="https://agentmods.dev/badge/skills/aphrody-code/bxc/bxc-grok-xai.svg" alt="Measured on agentmods" height="20"></a>
Per session 108 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 825 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00108 $0.00825
Opus 5 $0.00054 $0.00413
Sonnet 5 $0.00022 $0.00165
Haiku 4.5 $0.00011 $0.00082

Measured yesterday against content hash 8d152c7d4b60, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

bxc-grok-xai scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/bxc/skills/bxc-grok-xai/SKILL.md · 70 lines

How it starts

The opening of the file, as written. The whole thing — 70 lines — stays where its author put it; the contents beside it link to each section on GitHub.

@aphrody/xai — High-Level Grok Client (Bun native, keyless)

OpenAI-compatible client for api.x.ai/v1 with a fluent stateful Chat API inspired by the official Python xai-sdk, plus first-class support for native X tool calling via the sibling @aphrody/x package.

Auth (keyless first)

Resolution (in resolveAuth):

  1. Explicit bearer
  2. XAI_API_KEY (metered xai-...)
  3. SUPER_GROK_TOKEN / GROK_SUPER_TOKEN env (preferred for gratuite)
  4. ~/.grok/auth.json (from grok login, OIDC JWT) → treated as supergrok mode if not xai- key

Non-xai- tokens → "supergrok" / "grok_oidc" mode. Full compatibility for agent flows without billing.

High-Level API (the main thing)

const grok = new XaiClient();
const chat = grok.createChat("grok-3", { 
  messages: [system("You are helpful.")],
  tools: xNativeTools,           // from @aphrody/xai
  reasoning_effort: "high",
  response_format: { type: "json_object" }
});
chat.append(user("..."));
const res = await chat.sample();
const n = await chat.executeToolCalls({ x_search: (a) => xTools.search(a), ... });
const stream = chat.stream(); // yields {content, toolCallDeltas, toolCalls, done, response?}
const structured = await chat.sampleStructured(schema?);

executeToolCalls(handlersOrXToolsInstance) auto-dispatches or uses provided map. Appends role: "tool" messages automatically.

XTools class (in tools/x.ts) wraps a real or mocked XClient from @aphrody/x. Constructor accepts optional prebuilt client for unit tests.

xNativeTools array of tool defs ready to pass to createChat.

Integration with native X (@aphrody/x)

Grok can emit x_search / x_profile / x_whoami / x_tweets / x_news tool_calls. Fulfillment is done locally with cookie-stealth XClient + local SQLite + optional local For-You ranking (no external Twitter API, no extra keys).

See packages/xai/examples/grok-x-agent.ts for a complete runnable loop.

Low-level still supported

client.chat(), client.stream(), listModels(), etc. for when you need raw control.

Read the full file on GitHub · 70 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · +1 lines · -3 tokens per session 8d152c7d4b60
  2. 6d ago First seen · 69 lines · 111 tokens per session scan A e96a48028483

Subscribe to this mod's changes

bxc-grok-xai is a skill published in the GitHub repository aphrody-code/bxc (3 stars, last pushed today), licensed Apache-2.0. It adds 108 tokens to every session and 825 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

pinchtab-opt

Run the PinchTab optimization loop (Docker, 3 blind subagents on the runner's HIGH model, 108 steps across 47 groups) against chrome, cloak, ghost-chrome, or all three providers. Pass setup (optionally followed by a provider or all) to run only the setup test (native binary, single subagent forced to the runner's LOW…

pinchtab/pinchtab · 161 tokens

using-claude-cli

How to drive claude (Claude Code) as a non-interactive CLI tool — headless runs, MCP servers, permissions, output formats, and piping. Use when scripting Claude, spawning a sub-agent from another process, or wiring Claude into CI/automation.

developerz-ai/ui-debugger-mcp · 61 tokens

open-source

Documentation reference for writing Python code using the browser-use open-source library. Use this skill whenever the user needs help with Agent, Browser, or Tools configuration, is writing code that imports from browseruse, asks about @sandbox deployment, supported LLM models, Actor API, custom tools, lifecycle…

browser-use/browser-use · 137 tokens

tool-prompt-optimization

Optimize the description prompts an AI agent reads to learn its built-in tools (the .md files under prompts/tools/). Two halves: (1) measure how much of a prompt is already inferable from the tool's JSON parameter schema + name, to prune redundancy with evidence; (2) house authoring rules for what belongs in a tool…

can1357/oh-my-pi · 0 tokens

pinchtab

Use this skill when a task needs browser automation through PinchTab: open a website, inspect interactive elements, click through flows, fill out forms, scrape page text, reuse a dedicated automation profile with user approval, export screenshots or PDFs, manage multiple browser instances, or fall back to the HTTP API…

pinchtab/pinchtab · 94 tokens

pinchtab-mcp

Use this skill when a task requires browser automation through PinchTab's MCP server connected to a remote browser instance. Covers navigation, element interaction, data extraction, form filling, multi-step flows, and session management via MCP tools.

pinchtab/pinchtab · 52 tokens