Integrations Overview
TokenSG speaks both the OpenAI Chat Completions protocol and the Anthropic Messages protocol (/v1/chat/completions + /v1/messages), so virtually every mainstream developer CLI, IDE extension, and SDK can talk to TokenSG without code changes. The matrix below covers the five officially tested integrations; any other OpenAI-compatible tool works via the Generic OpenAI-Compatible guide.
Supported integrations
| Integration | Protocol | Guide |
|---|---|---|
| Claude Code | Anthropic Messages (/v1/messages) | Claude Code |
| OpenCode | OpenAI Chat or Anthropic Messages | OpenCode |
| OpenAI Codex CLI | OpenAI Chat (wire_api = "chat") | Codex CLI |
| Gemini CLI | Limited (native Google GLA only) — workaround via OpenAI-compatible CLI | Gemini CLI |
| Generic OpenAI-Compatible | OpenAI Chat — Cursor, Cline, Continue.dev, Vercel AI SDK, LangChain, LlamaIndex, etc. | OpenAI-Compatible Tools |
Not sure which one to pick?
| Your primary goal | Recommended path |
|---|---|
| Use Claude models through a dedicated agentic CLI | Claude Code or OpenCode (Anthropic mode) |
| Use GPT-4o / o3 / o4-mini in a terminal coding agent | OpenAI Codex CLI or OpenCode (OpenAI mode) |
| Use Gemini models programmatically | Any OpenAI-Compatible CLI with model: "gemini-2.5-pro" — TokenSG routes to Google GLA / Vertex internally (see Gemini CLI for why the native CLI itself is a poor fit) |
| Drive TokenSG from Cursor / Cline / Continue / Zed / Vercel AI SDK / LangChain / any IDE plugin | Generic OpenAI-Compatible — change base_url and go |
| Build custom automation in Python / Node.js / Go | OpenAI SDK with base_url = https://api.tokensg.ai/v1 — see Quick Start |
Universal basics
- OpenAI-compatible endpoint:
https://api.tokensg.ai/v1 - Anthropic-compatible endpoint:
https://api.tokensg.ai(the SDK appends/v1/messagesautomatically) - Authentication:
Authorization: Bearer sk-xxx— TokenSG does not accept Anthropic-stylex-api-key - Verifying: open the Dashboard and watch Request Logs / Today's Usage — a new row means you're connected
Don't see your tool?
Any tool that lets you change the OpenAI base URL will work — follow the Generic OpenAI-Compatible pattern. If you'd like us to add a dedicated page, please open a PR on github.com/xmai-ai/xmai-docs.