The unified interface for LLMs. Find the best models & prices for your prompts

计费方式

按量计费

价格区间

$0.001/1k tokens

注册方式

邮箱、Google、GitHub

支持模型

GPT-4oClaude 3.5Gemini ProLlama 3Mixtral
最后更新:2026-03-16

如何接入 OpenRouter

OpenRouter 接口完全兼容 OpenAI API 格式。只需将 base_url 替换为中转站地址,即可在任何支持自定义 API 端点的客户端或代码中使用。

from openai import OpenAI

client = OpenAI(
    api_key="你的 OpenRouter API Key",
    base_url="https://openrouter.ai/v1"
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "你好"}]
)
print(response.choices[0].message.content)

常见问题

OpenRouter 支持哪些模型?

OpenRouter 支持 GPT-4o、Claude 3.5、Gemini Pro、Llama 3、Mixtral 等模型。

OpenRouter 价格如何?

价格区间为 $0.001/1k tokens,按量计费。建议参考官网实时价格页面。

国内可以直接访问 OpenRouter 吗?

OpenRouter 提供 API 中转服务,国内用户可直接调用其 API 接口,无需自行翻墙。