简介
OpenRouter 是一个统一 API 网关,GitHub 3,000+ stars。一个 API Key 访问 200+ LLM 模型,支持自动降级、实时价格比较和智能路由。适合需要多模型访问而不想管理多个 API 密钥的开发者。
Single API endpoint for 200+ LLM models with automatic fallbacks, price comparison, and usage tracking. Route to the cheapest or fastest model that fits your needs. 3,000+ stars.
这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。
from openai import OpenAI
client = OpenAI(base_url="https://openrouter.ai/api/v1", api_key="sk-or-...")
response = client.chat.completions.create(
model="anthropic/claude-sonnet-4-20250514", messages=[{"role": "user", "content": "你好"}]
)OpenRouter 是一个统一 API 网关,GitHub 3,000+ stars。一个 API Key 访问 200+ LLM 模型,支持自动降级、实时价格比较和智能路由。适合需要多模型访问而不想管理多个 API 密钥的开发者。
Created by OpenRouter. Licensed under MIT.
openrouter — ⭐ 3,000+