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
However do note that even for models that do support structured outputs some providers don't have support, and we might fall back to json_object for them.
To force OpenRouter to only route to providers that support json_schema you also have to set require_parameters=true in the providers object. Documentation
It would be great if that supported_parameters information was available in the JSON list of models too. As it stands I'm going to have to fetch and cache two JSON files - this one https://openrouter.ai/api/v1/models and also this one https://openrouter.ai/api/v1/models?supported_parameters=structured_outputs - then compare the two at runtime to decide which models support which features.
I just added schema support to my CLI tool for accessing models:
I don't have a good way to tell which models support schemas programmatically, so I had to warn people in the README that some models might not work: https://github.com/simonw/llm-openrouter/blob/0.4/README.md#schemas
If this API endpoint https://openrouter.ai/api/v1/models included an indication as to if the model supports structured output support or not I could use that information in my own tool.
It currently looks like this:
The text was updated successfully, but these errors were encountered: