SpaceXAI published an experimental TypeScript Software Development Kit (SDK) on npm on 2 October 2026. The package, @xai-official/sdk, provides a typed client for Grok text, voice, image, and video features, along with tools that run on SpaceXAI’s servers. The latest release is version 0.2.3, and the SDK remains in pre-1.0 development for the time being as an experimental release.
What a Developer Can Call
The client has no runtime or peer dependencies. It supports the Responses API, image and video generation, the Files API, the Batch API, and the Voice API. It also includes tokenization, model lookup, and account lookup.
Additional features include streaming, structured output, function tools, image input, file uploads, batch processing, text-to-speech, transcription, multi-turn conversations, and access to usage data and HTTP metadata.
Hosted Tools and Local Tools
Several tools run on SpaceXAI’s servers. Web search retrieves online information, while X search provides real-time access to posts on X. Code execution runs Python in a server-side sandbox, and collections search enables searches across hosted files. Image generation is available both as a direct client call and as a hosted tool. Remote MCP and tool search also run on SpaceXAI’s servers.
Function tools and the shell tool instead run locally within the developer’s own application rather than on SpaceXAI’s servers.
Install Requirements
The SDK requires Node.js 22.13.0 or later and uses ECMAScript modules (ESM). Developers must use an ESM-compatible project, and the client reads the API key from the XAI_API_KEY environment variable.
To install the package, run npm install @xai-official/sdk or pnpm add @xai-official/sdk. A standard install follows npm’s latest tag, which currently points to version 0.2.3.
The package is available on npm, while its homepage and source repository are hosted on GitHub. The SDK blocks use in browsers and Workers by default to prevent secret API keys from being exposed in client-side code.
The package uses the Apache-2.0 license, and its its listed author is SpaceXAI, with support available at [email protected].
Pin a Version
The SDK is still in early development, and its interfaces may change before version 1.0. Developers should consider pinning a specific version to avoid unexpected changes. Currently, the latest version is 0.2.3 published on 7 October 2026. Before upgrading, check the changelog for breaking changes. Feedback and bug reports can be submitted through the repository’s GitHub issues.

