Skip to content

Capabilities ​

@anvia/grok combines OpenAI-compatible completion adapters with xAI-specific tools and media endpoints.

CapabilitySupport
Responses completion and streamingYes, default
Chat Completions and streamingYes
Local Anvia toolsYes
xAI provider toolsResponses only
Image generationYes
Batch text-to-speechYes
Batch transcriptionYes
Model listingYes
EmbeddingsNot implemented
Video, realtime voice, streaming speechNot implemented

Completion adapters ​

GrokResponsesCompletionModel delegates normalized Responses behavior to the OpenAI adapter and adds Grok provider-tool and source normalization. GrokChatCompletionModel delegates Chat Completions behavior but does not accept provider-executed tools.

Known Grok IDs expose context limits. Provider-specific request fields can pass through completion additionalParams.

Provider tools ​

Web search, X search, code interpreter, file search, and remote MCP return Anvia ProviderTool values. They are sent to xAI and never executed by the local ToolSet. Local tools and provider tools can coexist in one agent.

Images ​

The image adapter requests base64 by default and also accepts provider URL output when fetch is available. Width and height map to supported xAI ratios; unknown ratios become auto, and explicit provider aspect_ratio wins.

Speech ​

Text-to-speech calls /tts and accepts binary or JSON/base64 output. The current adapter rejects any speed other than 1 because xAI does not expose speed control through this path.

Transcription calls /stt with multipart audio and returns normalized text. Both operations require fetch and a usable API key.

Unsupported surfaces ​

The package does not expose image editing, video generation, realtime voice, streaming speech, file/collection management, batches, stored completions, compaction, or native telemetry APIs. Call a provider API directly when no Anvia contract exists.

Built for Anvia.