sync-xai-api

sync-xai-api is a command for Claude Code from enricoros/big-AGI. It costs 10 tokens per session (1,047 once invoked), scanned A, original, MIT.

A command for updating an integration with xAI’s Responses API, the web API used to send requests to xAI models and receive their answers.

In plain words
What is it for?
Use it when reviewing or synchronizing the xAI adapter, request schemas, dialect routing, and shared response handling in the codebase.
Why use it?
It helps find changes in xAI’s latest documentation and keep request types, routing, and response parsing aligned with that API.

Command for Claude Code

About the project

Big-AGI is an open-source workspace for using multiple AI models through chat and other AI functions. It is intended for engineers, founders, researchers, and other users who want to work with AI personas, model comparisons, image generation, voice, documents, and code-related features. The catalogue entries provide commands, instructions, and a skill for working with Big-AGI.

enricoros/big-AGI · 7,109 stars · on GitHub · big-agi.com

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.

agentmods
npx agentmods add commands/enricoros/big-agi/sync-xai-api
Clone the repo
git clone --depth 1 https://github.com/enricoros/big-AGI

Made for: Claude Code.

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 sync-xai-api

README.md
[![agentmods](https://agentmods.dev/badge/commands/enricoros/big-agi/sync-xai-api.svg)](https://agentmods.dev/commands/enricoros/big-agi/sync-xai-api)
Your own site
<a href="https://agentmods.dev/commands/enricoros/big-agi/sync-xai-api"><img src="https://agentmods.dev/badge/commands/enricoros/big-agi/sync-xai-api.svg" alt="Measured on agentmods" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,047 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00010 $0.01047
Opus 5 $0.00005 $0.00524
Sonnet 5 $0.00002 $0.00209
Haiku 4.5 $0.00001 $0.00105

Measured 6d ago against content hash fdbd2544852b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

sync-xai-api 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 6d 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.

.claude/commands/aix/sync-xai-api.md · 59 lines

How it starts

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

Review the xAI Responses API implementation:

  • xAI wire types: src/modules/aix/server/dispatch/wiretypes/xai.wiretypes.ts (xAI-specific request schema, tools)
  • Request adapter: src/modules/aix/server/dispatch/chatGenerate/adapters/xai.responsesCreate.ts (AIX → xAI Responses API)
  • Response parser: src/modules/aix/server/dispatch/chatGenerate/parsers/openai.responses.parser.ts (shared with OpenAI Responses)
  • Dispatch routing: src/modules/aix/server/dispatch/chatGenerate/chatGenerate.dispatch.ts (dialect='xai' routing)
  • OpenAI shared types: src/modules/aix/server/dispatch/wiretypes/openai.wiretypes.ts (InputItem/OutputItem schemas reused by xAI)

IMPORTANT context:

  • We use ONLY the xAI Responses API (POST /v1/responses). We do NOT use the Chat Completions API (/v1/chat/completions) for xAI anymore.
  • xAI's Responses API is similar to OpenAI's but has key differences - the skill should find what changed since our last sync.
  • Response streaming/parsing reuses the OpenAI Responses parser since the format is compatible.
  • We do NOT implement: Files API, Collections Search, Remote MCP tools, Voice Agent API, Image/Video generation, Batch API, or Deferred Completions.

Then take a look at the newest API information available. Try these sources, and be creative if some are blocked:

Primary Sources (guide pages work well with WebFetch despite being JS-rendered):

Alternative Sources if primary blocked:

If all blocked: Explain what you attempted and ask user to provide documentation manually.

Live endpoint (extra signal): If .env.api-keys has XAI_API_KEY, fire a real streaming Responses request and inspect the raw SSE - ground-truth for xAI-specific output items, event types, and usage fields that docs lag: POST https://api.x.ai/v1/responses ("stream":true). Never commit or echo the key.

$ARGUMENTS Check carefully for discrepancies between our implementation and the current API docs:

  1. Request fields: Compare XAIWire_API_Responses.Request_schema against current docs - any new, changed, or deprecated parameters?
  2. Tool definitions: Compare XAIWire_Responses_Tools - any new parameters on web_search/x_search/code_interpreter? Any new hosted tool types?
  3. Input/Output item types: Any xAI-specific output items not handled by the shared OpenAI parser (e.g., x_search_call, web_search_call, code_interpreter_call)?
  4. Streaming events: Any xAI-specific SSE event types beyond what the OpenAI Responses parser handles?
  5. Response shape: Usage reporting differences, new fields in the response object?
  6. Adapter logic: Message role mapping, content type handling, system message approach - still correct?
  7. Include options: Any new values for the include array?
  8. Reasoning config: Which models support it and with what values?

Prioritize breaking changes and new capabilities that would improve the user experience. When making changes, add comments with date: // [xAI, 2026-MM-DD]: explanation

Self-update this skill: After completing the sync, if your research reveals that assumptions in THIS skill file (.claude/commands/aix/sync-xai-api.md) are wrong or outdated - e.g., new APIs we now implement, new tool types added, URLs moved, file paths changed - update this skill file to stay accurate for next time.

Read the full file on GitHub · 59 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. 6d ago First seen · 59 lines · 10 tokens per session scan A fdbd2544852b

Subscribe to this mod's changes

sync-xai-api is a command published in the GitHub repository enricoros/big-AGI (7,109 stars, last pushed yesterday), licensed MIT. It adds 10 tokens to every session and 1,047 once invoked, about $0.0001 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-30.