Structured Output creation with Python SDK is not ...
# support
j
Here is the simple test structure I am trying to create with python: from vapi import Vapi import config vapi = Vapi(token=config.VAPI_API_KEY) structured_output = vapi.structured_outputs.structured_output_controller_create( name="Test Output", schema={ "type": "object", "properties": { "testField": {"type": "string"} }, "required": ["testField"] } ) print(f'Created structured output: {structured_output.id}') and it gives "Internal Server Error" , StatusCode : 500. ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) vapi.core.api_error.ApiError: headers: {'date': 'Mon, 29 Sep 2025 14:57:47 GMT', 'content-type': 'application/json; charset=utf-8', 'content-length': '87', 'c onnection': 'keep-alive', 'cf-ray': '986c55bf8a2ef5e2-AMS', 'x-powered-by': 'Express', 'access-control-allow-origin': '*', 'x-robots-tag': 'noindex', 'etag': 'W/"57-TXCH3wKnwbC2P5/wyKGoUcqqAWw"', 'cf-cache-status': 'DYNAMIC', 'set-cookie': '_cfuvid=7u5s6fJghtFdkunisLJSaSwl97x1PAzlIGRGu6l8hkw-1759157867649-0.0.1.1-6 04800000; path=/; domain=.vapi.ai; HttpOnly; Secure; SameSite=None', 'server': 'cloudflare', 'alt-svc': 'h3=":443"; ma=86400'}, status_code: 500, body: {'statusCode': 500, 'message': 'Internal server error. Contact support@vapi.ai for help.'}
v
Try validating your JSON schema before making the API call, as schema formatting issues are a common cause of 500 errors. Here’s a quick way to check your schema using the
jsonschema
library:
Copy code
python
from jsonschema import validate, ValidationError

schema = {
    "type": "object",
    "properties": {"testField": {"type": "string"}},
    "required": ["testField"]
}

try:
    validate(instance={"testField": "example"}, schema=schema)
    print("Schema is valid.")
except ValidationError as e:
    print(f"Schema validation error: {e}")
If your schema is valid and you still get a 500 error, please contact support@vapi.ai with your request details for further assistance (as recommended in the documentation). Sources: - [Structured outputs quickstart](https://docs.vapi.ai/assistants/structured-outputs-quickstart) - [Structured outputs API reference](https://docs.vapi.ai/api-reference/structured-outputs/structured-output-controller-create) - [Issue reporting](https://docs.vapi.ai/issue-reporting)
v
That 500 error usually means the issue is on Vapi’s side, not your code. I can help you test the request payload directly to confirm if it’s the schema or just the API acting up. Have you tried creating the same structured output from the dashboard to see if it works there? @JO33
j
The problem is not from the schema, I am testing with the simplest schema and it still fails. Also, how can I add a structured output from the dashboard?
c
I have the same issue here so +1
c
We apologize for the delay in responses lately. We are in process of making some changes to our workflow in how we handle support requests. The good news is that we are starting to get back on track of having a 48 hour response time and we would like to start cleaning up anything old. With that being said, just wanted to check in with you to see if you have made any progress or changes to your project since support has last reached out.