In order to use text_format with the new Responses API you need to use the /parse endpoint, but there is no documentation for this online other than a brief mention on this page.
1 Like
Actually the endpoint is the same for both text and structured outputs. You can notice that in the curl examples.
What changes is the python sdk method that handles the request.
client.responses.create
returns a text outputclient.responses.parse
converts the text into an instance of the pydantic model you provided, for your convenience.
But if you were making a raw request using curl or http requests, the endpoint would still be the same.
1 Like