Simon Willison 介绍使用 OpenRouter 的供应商路由陷阱与对策

内容摘要
OpenRouter的一大优势是自动处理回退并选择每个请求的最经济选项,从而只需调用单个API端点即可获取最佳后端服务提供商。然而,不同提供商运行不同的服务软件,具有不同的优化和设置,导致同一OpenRouter端点可能服务于表现不同的模型请求。一些提供商甚至缺乏视觉模型的能力,推理努力选项的处理方式也可能不同。幸运的是,可以通过使用provider.only选项来控制路由到哪个提供商。/endpoints方法返回特定模型ID的可用提供商列表。
OpenRouter的一大优势是自动处理回退并选择每个请求的最经济选项,从而只需调用单个API端点即可获取最佳后端服务提供商。然而,不同提供商运行不同的服务软件,具有不同的优化和设置,导致同一OpenRouter端点可能服务于表现不同的模型请求。一些提供商甚至缺乏视觉模型的能力,推理努力选项的处理方式也可能不同。幸运的是,可以通过使用provider.only选项来控制路由到哪个提供商。/endpoints方法返回特定模型ID的可用提供商列表。

One of OpenRouter's selling points is that it "handles fallbacks automatically and picks the most cost-effective option for each request", so you can call a single API endpoint for a model and get routed to the best available backend provider.

Mohamed Moustafa points out a whole set of ways that this can cause you problems. Different providers run different serving software with different optimizations and settings, which means that the same OpenRouter endpoint can serve model requests that behave in different ways.

Some providers even lack vision capability for vision models, and the way the reasoning effort option is processed can differ as well.

Thankfully you can control which provider is routed to using the provider.only option. The /endpoints method returns the list of available providers for a specific model ID.

原始发布方:Simon Willison 博客

原文时间:2026-09-12 06:49:18 +08:00

阅读原文 · 数据来源:AIHOT

提示

本文用于信息整理与经验分享。第三方订阅、支付及账号服务可能调整,实际规则、价格和可用性请以下单页面及服务方最新说明为准。

咨询 GPT 充值咨询充值