Hey All! I'm using the json_schema structured output with gpt4o-mini (and other supported models) and keep getting the below response:
{"message":"Provider returned error","code":400,"metadata":{"raw":"{\n \"error\": {\n \"message
\": \"Unknown parameter: 'response_format.json_schema'.\",\n \"type\": \"invalid_request_error\",\n \"
param\": \"response_format.json_schema\",\n \"code\": \"unknown_parameter\"\n }\n}","provider_name":"Azu
re","isDownstreamPipeClean":true,"isErrorUpstreamFault":false}},"user_id":"user_2kq5WIvpdnpEH1e5Tu0NrlR6d3M"
}
I suspect that maybe it's related to openrouter routing the request to Azure and perhaps azure does not support it? My request in the exact same shape works fine with Gemini flash
Request:
"response_format": {
"type": "json_object",
"json_schema": {
"name": "schema",
"strict": true,
"schema": {
"properties": {
"cons": {
"items": {
"type": "string"
},
"type": "array"
},
"key_features": {
"items": {
"type": "string"
},
"type": "array"
},
"pros": {
"items": {
"type": "string"
},
"type": "array"
},
"summary": {
"type": "string"
},
"target_users": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"key_features",
"pros",
"cons",
"target_users",
"rating",
"summary"
],
"type": "object"
}
}
},
"tools": [],
"max_tokens": 1536,
"temperature": 0.7
}
}