TensaHub › OpenRouter

NVIDIA: Switchyard

OpenRouter 提供的 nvidia/switchyard 模型 API,价格见服务商,上下文 1,000,000 token。提供 curl、Python、JavaScript 示例及在线测试。

在目录中测试并评分

Switchyard is an open-source model routing system that switches between multiple models to optimize the cost of requests. By default it will use OpenRouter market data to select the most...

类型
模型
服务商
OpenRouter
模型 ID
nvidia/switchyard
价格
价格未公开
无需密钥访问
否
密钥环境变量
OPENROUTER_API_KEY
Base URL(兼容 OpenAI)
https://openrouter.ai/api/v1
上下文
1,000,000 token
输入
文本
开发者评分
暂无评分
文档
https://openrouter.ai/nvidia/switchyard

代码示例

cURL

curl https://openrouter.ai/api/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -d '{"model":"nvidia/switchyard","messages":[{"role":"user","content":"你好,请用一句话介绍你自己。"}]}'

Python

# pip install openai
import os
from openai import OpenAI

client = OpenAI(base_url="https://openrouter.ai/api/v1", api_key=os.environ["OPENROUTER_API_KEY"])
r = client.chat.completions.create(
    model="nvidia/switchyard",
    messages=[{"role": "user", "content": "你好,请用一句话介绍你自己。"}],
)
print(r.choices[0].message.content)

JavaScript

// npm install openai
import OpenAI from 'openai'

const client = new OpenAI({ baseURL: 'https://openrouter.ai/api/v1', apiKey: process.env.OPENROUTER_API_KEY })
const r = await client.chat.completions.create({
  model: 'nvidia/switchyard',
  messages: [{ role: 'user', content: '你好,请用一句话介绍你自己。' }],
})
console.log(r.choices[0].message.content)

生成集成代码 →

热门搜索

常见问题

NVIDIA: Switchyard API 免费吗?

价格未以标准形式公布,请查看服务商页面。

如何在代码中调用 NVIDIA: Switchyard?

NVIDIA: Switchyard 在 https://openrouter.ai/api/v1 提供兼容 OpenAI 的 API:使用任意 OpenAI SDK(Python、JavaScript 等)并设置该基础 URL 即可。 模型标识:nvidia/switchyard。 开发者工具箱中提供了即用代码(流式输出、JSON、重试)。

NVIDIA: Switchyard 的上下文窗口有多大?

NVIDIA: Switchyard 最多支持 1,000,000 个令牌的上下文(提示词和历史记录)。

NVIDIA: Switchyard 有哪些替代方案?

目录中的类似 API:NVIDIA: Nemotron 3 Nano Omni (free), NVIDIA: Nemotron 3.5 Super VL (free), NVIDIA: Nemotron 3.5 Lightning (free), NVIDIA: Nemotron 3 Ultra (free), NVIDIA-Nemotron-3-Ultra-550B-A55B-BF16 · CoreWeave。

替代方案