TopxAI
TopxAI is an API gateway that provides access to
models from multiple AI providers through an OpenAI-compatible API. You can use
its Chat Completions endpoint with the AI SDK through the
@ai-sdk/openai-compatible module.
Setup
Install the OpenAI Compatible provider:
$ pnpm add @ai-sdk/openai-compatible
$ npm install @ai-sdk/openai-compatible
$ yarn add @ai-sdk/openai-compatible
$ bun add @ai-sdk/openai-compatible
Create a TopxAI API key, choose a route that includes the models you want to use, and set the key as a server-side environment variable:
See the TopxAI API key guide for details.
Provider Instance
Create a TopxAI provider instance with createOpenAICompatible:
The apiKey setting sends the key as a Bearer token in the Authorization
header. includeUsage: true requests usage information in streaming responses.
Language Models
Create a language model by passing a TopxAI model ID to the provider instance:
Example
Use generateText to generate text with the model:
You can also use TopxAI language models with streamText.
Supported Models and Capabilities
TopxAI exposes the following text model IDs through its OpenAI-compatible Chat Completions endpoint:
| Provider | Model IDs |
|---|---|
| Anthropic | claude-fable-5-1, claude-opus-5-5, claude-sonnet-5-5 |
| OpenAI | gpt-6-astra, gpt-6.1-sol |
| xAI | grok-4.7 |
| Zhipu AI | GLM-5.3-Abliterated |
| Moonshot | kimi-k3 |
| DeepSeek | deepseek-flash, deepseek-v4-pro |
The available models and the routes enabled for a key can change. Use the
authenticated GET /v1/models endpoint or
the TopxAI model and pricing catalog for the
current model IDs.
The jev-1.14.0 model in the TopxAI catalog uses a separate System One
endpoint and is not available through this Chat Completions integration.
Supported capabilities depend on the selected model and include:
- text generation and streaming;
- tool calling, including multi-step tool use with
stopWhen; - reasoning content and reasoning token usage for reasoning models such as
deepseek-flash; and - structured output for models that support JSON Schema.
To send JSON Schema structured-output requests, enable
supportsStructuredOutputs:
This guide covers TopxAI's OpenAI-compatible Chat Completions endpoint. TopxAI also documents using the AI SDK OpenAI and Anthropic providers with its Responses and Messages APIs.