You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In packages/ai/src/types.ts, add next to the already existing fields only and order also all missing fields that are specified in the provider object for the OpenRouter API.
Specifically, adding to only and order, the missing fields are allow_fallbacks, require_parameters, data_collection, zdr, enforce_distillable_text, ignore, quantizations, sort, preferred_min_throughput, preferred_max_latency, max_price
In the documentation of pi for models.json, remove "fallbacks": ["openai"] in compat in the object in the array providers.openrouter.models.
In the same documentation page, add the information that the object set in openRouterRouting is exactly what the provider field will be set to in the OpenRouter API.
In the same example as above, change"order": ["anthropic"] to "order": ["Anthropic"], as I believe the case is important to the OpenRouter API.
Why?
Even though everything gets passed anyway at runtime, the fields are not defined in typescript.
The runtime literally does params.provider = model.compat.openRouterRouting;, so what I am saying should all be true.
The current documentation seems to be wrong: Eventhough "fallbacks": ["openai"] in compat in the object in the array providers.openrouter.models would be passed as { "provider": { "fallbacks": ...} } in the OpenRouter API, this is not specified in the OpenRouter API.
What do you want to change?
packages/ai/src/types.ts, add next to the already existing fieldsonlyandorderalso all missing fields that are specified in theproviderobject for the OpenRouter API.onlyandorder, the missing fields areallow_fallbacks,require_parameters,data_collection,zdr,enforce_distillable_text,ignore,quantizations,sort,preferred_min_throughput,preferred_max_latency,max_pricepiformodels.json, remove"fallbacks": ["openai"]incompatin the object in the arrayproviders.openrouter.models.openRouterRoutingis exactly what theproviderfield will be set to in the OpenRouter API."order": ["anthropic"]to"order": ["Anthropic"], as I believe the case is important to the OpenRouter API.Why?
params.provider = model.compat.openRouterRouting;, so what I am saying should all be true."fallbacks": ["openai"]incompatin the object in the arrayproviders.openrouter.modelswould be passed as{ "provider": { "fallbacks": ...} }in the OpenRouter API, this is not specified in the OpenRouter API.How? (optional)
No response