bxc-grok-xai

bxc-grok-xai is a skill for Claude Code 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 Code

Written for Claude Code: shipped in a Claude Code plugin.

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, stream responses, use tools, or authenticate with an API key or supported Grok login.

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.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for bxc-grok-xai

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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.5 $0.00043 $0.00330
Sonnet 5.5 $0.00022 $0.00165
Haiku 4.5 $0.00011 $0.00082

Measured 2mo ago against content hash 8d152c7d4b60, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo ago.

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. 2mo ago Changed · +1 lines · -3 tokens per session 8d152c7d4b60
  2. 3mo 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 2mo ago), licensed Apache-2.0. It adds 108 tokens to every session and 825 once invoked, about $0.0004 per session on Opus 5.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

bxc-grok-xai compared with skills from other repositories

bxc-grok-xai next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
bxc-grok-xaiaphrody-code/bxcSkill32mo agoApache-2.0A108Claude Code
pinchtab-optpinchtab/pinchtabSkill11k8d agoMITC161Claude Code, Codex
using-claude-clideveloperz-ai/ui-debugger-mcpSkill23d agoMITA61Claude Code, Codex
open-sourcebrowser-use/browser-useSkill123kyesterdayMITA101Claude Code
tool-prompt-optimizationcan1357/oh-my-piSkill40kyesterdayMITA0Claude Code, Codex
pinchtabpinchtab/pinchtabSkill11k8d agoMITA94Codex
pinchtab-mcppinchtab/pinchtabSkill11k8d agoMITA52Claude Code, Codex