Error 500 in create structured output
# support
r
When I try to create an output structure via API, I get this response: json Copiar { "statusCode": 500, "message": "Internal server error. Contact support@vapi.ai for help." } My request body looks like this: json Copiar { "name": "Call Summary", "schema": { "type": "string", "description": "You are an expert at taking notes. Summarize the call in 2 to 3 sentences, focusing on the main points and outcomes. Be concise and record the most important information." }, "description": "Generates a concise summary that captures the main points and outcomes of the conversation." } sage": "Internal server error. Contact support@vapi.ai for help." } Org ID: 61d09b13-129f-4353-9eb3-0e7ee89eb6b8
c
Hi there, The format you’re using is incorrect. Please ensure that the
type
is set to
object
or
array
as appropriate. For example, in your last failed request, the
schema.type
was set to
"string"
, but it should be
"object"
if you intend to define properties. For reference, please review the following documentation for the correct formats: • [https://docs.vapi.ai/assistants/structured-outputs-quickstart](https://docs.vapi.ai/assistants/structured-outputs-quickstart) • [https://docs.vapi.ai/assistants/structured-outputs-examples](https://docs.vapi.ai/assistants/structured-outputs-examples)
r
Even now that I’ve used the ideal format, I’m still getting a 500 error: json Copiar { "name": "Call Summary", "schema": { "type": "object", "properties": { "value": { "type": "string", "description": "You are an expert at taking notes. Summarize the call in 2 to 3 sentences, focusing on the main points and outcomes. Be concise and record the most important information." } }, "required": [ "value" ] }, "description": "Generates a concise summary that captures the main points and outcomes of the conversation.", "model": { "provider": "openai", "model": "gpt-4.1" } } And this is the API response I’m getting: json Copiar { "statusCode": 500, "message": "Internal server error. Contact support@vapi.ai for help." }
c
Please try after removing the model object.
r
Now I removed the model and it’s still returning a 500 error: { "name": "Call Summary", "schema": { "type": "object", "properties": { "value": { "type": "string", "description": "You are an expert at taking notes. Summarize the call in 2 to 3 sentences, focusing on the main points and outcomes. Be concise and record the most important information." } }, "required": [ "value" ] }, "description": "Generates a concise summary capturing the main points and outcomes of the conversation." }
c
Could you please try this and check if this works:
Copy code
{
  "name": "call_summary",
  "description": "Summarizes the call in 2–3 sentences.",
  "schema": {
    "type": "object",
    "properties": {
      "summary": {
        "type": "string",
        "description": "Concise summary of the call"
      }
    },
    "required": [
      "summary"
    ]
  }
}
r
g
VAPI tools must be attached to the assistant (not calls), explicitly referenced in the system prompt, and cannot be created standalone. If not, VAPI throws a generic 500 instead of a validation error.
c
Could you please try this:
Copy code
{
  "name": "test schema 2",
  "schema": {
    "type": "object",
    "required": [
      "test"
    ],
    "properties": {
      "test": {
        "type": "string",
        "description": "test"
      }
    }
  },
  "type": "ai"
}
r
It worked, my friend! Thank you so much!