Official Docs PythonNode.jsSDK integration 更新于 2026-11-18 · 约 4 分钟读完

Python and Node.js / TypeScript official SDK multi-model unified calling guide

Transform existing business code with zero intrusion! Just replace base_url and api_key, and you can use the standard OpenAI / Anthropic official SDK to uniformly call 250+ mainstream large models around the world.

Core Design Principle: Zero Private SDK Bindings

The biggest taboo in integrating enterprise-level large model gateways is the introduction of closed private SDKs. Through the standard compatibility layer and the native pass-through layer, your team's existing OpenAI SDK, Anthropic SDK, LangChain, LlamaIndex and Vercel AI SDK can be smoothly migrated by just changing one line base_url.

Python streaming call example (OpenAI official library)

python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://suptoken.ai/v1",
    api_key=os.environ.get("SUPTOKEN_API_KEY", "sk-your-key"),
)

response = client.chat.completions.create(
    model="claude-sonnet-4-5",
    messages=[
        {"role": "system", "content": "你是一位资深分布式系统架构师。"},
        {"role": "user", "content": "简述高并发网关如何设计令牌桶限流?"},
    ],
    stream=True,
)

for chunk in response:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

TypeScript / Vercel AI SDK calling example

typescript
import OpenAI from 'openai';

const openai = new OpenAI({
  baseURL: 'https://suptoken.ai/v1',
  apiKey: process.env.SUPTOKEN_API_KEY,
});

const completion = await openai.chat.completions.create({
  model: 'gemini-2.5-pro',
  messages: [{ role: 'user', content: '分析这段 SQL 慢查询并给出索引建议' }],
});

console.log(completion.choices[0]?.message?.content);

🚀 准备好在项目中极速接入了吗?

注册即可创建专属 API Key,原生直连 Claude 4.5、GPT-5 Codex 与 Gemini 2.5 Pro。

在线流式测试 免费获取 API Key →

相关推荐阅读