Logo

azure-openai

#10015

invalid_parameter_error

Invalid parameter: the specified response format is not supported with the current model.

This error has been identified and solved.

Reason

The error you are encountering, specifically the 400 status error with the message "Invalid parameter: 'response_format' of type 'json_object' is not supported with this model," is due to several reasons related to the compatibility and configuration of the response_format parameter:

Model Compatibility

The response_format parameter set to {"type": "json_object"} is not supported by the model you are using. Different models in the OpenAI API have varying levels of support for different response formats, and the model you are using does not support the json_object format.

Tool Type Constraints

When using the response_format of type json_object or json_schema, all tools specified in the request must be of type function. If other types of tools, such as file_search or code_interpreter, are included, it will trigger this error.

This mismatch between the requested response format and the capabilities of the model or tools being used results in the 400 status error.

Solution

To fix the 400 status error due to the response_format parameter not being supported by the model, you need to make the following adjustments:

  • Remove the response_format parameter: If the model does not support the specified response format, removing this parameter will allow the API to default to a supported format.

  • Change the model: Switch to a model that supports the json_object response format, if such a model is available.

  • Ensure tool compatibility: If using tools in your request, ensure all tools are of the type function when specifying a json_object or json_schema response format.

By making these changes, you can resolve the compatibility issue and successfully submit your request to the Azure OpenAI API.

Original Error Message

Raw

Invalid parameter: the specified response format is not supported with the current model.

Original Error Message

Raw

Invalid parameter: the specified response format is not supported with the current model.

© 2024 Portkey, Inc. All rights reserved

HIPAA

COMPLIANT

GDPR

Transform Your AI app prototypes to be production-ready

Talk to us →