{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://api-evangelist.com/schemas/vapi/vapi-structured-output-schema.json", "title": "Vapi StructuredOutput", "description": "JSON Schema for the Vapi StructuredOutput resource as returned by the Vapi API.", "type": "object", "properties": { "type": { "type": "string", "description": "This is the type of structured output.\n\n- 'ai': Uses an LLM to extract structured data from the conversation (default).\n- 'regex': Uses a regex pattern to extract data from the transcript without an LLM.", "enum": [ "ai", "regex" ] }, "regex": { "type": "string", "description": "This is the regex pattern to match against the transcript.\n\nOnly used when type is 'regex'. Supports both raw patterns (e.g. '\\d+') and\nregex literal format (e.g. '/\\d+/gi'). Uses RE2 syntax for safety.\n\nThe result depends on the schema type:\n- boolean: true if the pattern matches, false otherwise\n-" }, "model": { "description": "This is the model that will be used to extract the structured output.\n\nTo provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages.\nBetween the ", "oneOf": [ { "type": "object", "properties": { "provider": { "type": "string", "description": "This is the provider of the model (`openai`).", "enum": [ "openai" ] }, "model": { "type": "string", "description": "This is the OpenAI model that will be used.\n\nWhen using Vapi OpenAI or your own Azure Credentials, you have the option to specify the region for the selected model. This shouldn't be specified unless you have a specific reason to do so. Vapi will automatically find the fastest region that make sense", "enum": [ "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "gpt-5.2", "gpt-5.2-chat-latest", "gpt-5.1", "gpt-5.1-chat-latest", "gpt-5", "gpt-5-chat-latest", "gpt-5-mini" ] }, "temperature": { "type": "number", "description": "This is the temperature of the model." }, "maxTokens": { "type": "number", "description": "This is the max tokens of the model." } }, "required": [ "provider", "model" ] }, { "type": "object", "properties": { "provider": { "type": "string", "description": "This is the provider of the model (`anthropic`).", "enum": [ "anthropic" ] }, "model": { "type": "string", "description": "This is the specific model that will be used.", "enum": [ "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307", "claude-3-5-sonnet-20240620", "claude-3-5-sonnet-20241022", "claude-3-5-haiku-20241022", "claude-3-7-sonnet-20250219", "claude-opus-4-20250514", "claude-opus-4-5-20251101", "claude-opus-4-6" ] }, "thinking": { "description": "This is the optional configuration for Anthropic's thinking feature.\n\n- If provided, `maxTokens` must be greater than `thinking.budgetTokens`." }, "temperature": { "type": "number", "description": "This is the temperature of the model." }, "maxTokens": { "type": "number", "description": "This is the max tokens of the model." } }, "required": [ "provider", "model" ] }, { "type": "object", "properties": { "provider": { "type": "string", "description": "This is the provider of the model (`anthropic-bedrock`).", "enum": [ "anthropic-bedrock" ] }, "model": { "type": "string", "description": "This is the specific model that will be used.", "enum": [ "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307", "claude-3-5-sonnet-20240620", "claude-3-5-sonnet-20241022", "claude-3-5-haiku-20241022", "claude-3-7-sonnet-20250219", "claude-opus-4-20250514", "claude-opus-4-5-20251101", "claude-opus-4-6" ] }, "thinking": { "description": "This is the optional configuration for Anthropic's thinking feature.\n\n- If provided, `maxTokens` must be greater than `thinking.budgetTokens`." }, "temperature": { "type": "number", "description": "This is the temperature of the model." }, "maxTokens": { "type": "number", "description": "This is the max tokens of the model." } }, "required": [ "provider", "model" ] }, { "type": "object", "properties": { "provider": { "type": "string", "description": "This is the provider of the model (`google`).", "enum": [ "google" ] }, "model": { "type": "string", "description": "This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b", "enum": [ "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", "gemini-2.0-flash-thinking-exp", "gemini-2.0-pro-exp-02-05", "gemini-2.0-flash", "gemini-2.0-flash-lite", "gemini-2.0-flash-exp", "gemini-2.0-flash-realtime-exp" ] }, "temperature": { "type": "number", "description": "This is the temperature of the model." }, "maxTokens": { "type": "number", "description": "This is the max tokens of the model." } }, "required": [ "provider", "model" ] }, { "type": "object", "properties": { "provider": { "type": "string", "description": "This is the provider of the model (`custom-llm`).", "enum": [ "custom-llm" ] }, "metadataSendMode": { "type": "string", "description": "This determines whether metadata is sent in requests to the custom provider.\n\n- `off` will not send any metadata. payload will look like `{ messages }`\n- `variable` will send `assistant.metadata` as a variable on the payload. payload will look like `{ messages, metadata }`\n- `destructured` will send", "enum": [ "off", "variable", "destructured" ] }, "url": { "type": "string", "description": "These is the URL we'll use for the OpenAI client's `baseURL`. Ex. https://openrouter.ai/api/v1" }, "headers": { "type": "object", "description": "These are the headers we'll use for the OpenAI client's `headers`." }, "timeoutSeconds": { "type": "number", "description": "This sets the timeout for the connection to the custom provider without needing to stream any tokens back. Default is 20 seconds." }, "model": { "type": "string", "description": "This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b" }, "temperature": { "type": "number", "description": "This is the temperature of the model." }, "maxTokens": { "type": "number", "description": "This is the max tokens of the model." } }, "required": [ "provider", "url", "model" ] } ] }, "compliancePlan": { "description": "Compliance configuration for this output. Only enable overrides if no sensitive data will be stored.", "allOf": [ { "type": "object", "properties": { "forceStoreOnHipaaEnabled": { "type": "boolean", "description": "Force storage for this output under HIPAA. Only enable if output contains no sensitive data." } } } ] }, "id": { "type": "string", "description": "This is the unique identifier for the structured output." }, "orgId": { "type": "string", "description": "This is the unique identifier for the org that this structured output belongs to." }, "createdAt": { "type": "string", "description": "This is the ISO 8601 date-time string of when the structured output was created.", "format": "date-time" }, "updatedAt": { "type": "string", "description": "This is the ISO 8601 date-time string of when the structured output was last updated.", "format": "date-time" }, "name": { "type": "string", "description": "This is the name of the structured output." }, "description": { "type": "string", "description": "This is the description of what the structured output extracts.\n\nUse this to provide context about what data will be extracted and how it will be used." }, "assistantIds": { "type": "array", "description": "These are the assistant IDs that this structured output is linked to.\n\nWhen linked to assistants, this structured output will be available for extraction during those assistant's calls.", "items": { "type": "string" } }, "workflowIds": { "type": "array", "description": "These are the workflow IDs that this structured output is linked to.\n\nWhen linked to workflows, this structured output will be available for extraction during those workflow's execution.", "items": { "type": "string" } }, "schema": { "description": "This is the JSON Schema definition for the structured output.\n\nDefines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including:\n- Objects and nested properties\n- Arrays and array validation\n- String, number, boolean, and null types\n- Enums ", "allOf": [ { "type": "object", "properties": { "type": { "type": "string", "description": "This is the type of output you'd like.\n\n`string`, `number`, `integer`, `boolean` are the primitive types and should be obvious.\n\n`array` and `object` are more interesting and quite powerful. They allow you to define nested structures.\n\nFor `array`, you can define the schema of the items in the array", "enum": [ "string", "number", "integer", "boolean", "array", "object" ] }, "items": { "description": "This is required if the type is \"array\". This is the schema of the items in the array. This is a recursive reference to JsonSchema." }, "properties": { "type": "object", "description": "This is required if the type is \"object\". This specifies the properties of the object. This is a map of property names to JsonSchema objects." }, "description": { "type": "string", "description": "This is the description to help the model understand what it needs to output." }, "pattern": { "type": "string", "description": "This is the pattern of the string. This is a regex that will be used to validate the data in question. To use a common format, use the `format` property instead.\n\nOpenAI documentation: https://platform.openai.com/docs/guides/structured-outputs#supported-properties" }, "format": { "type": "string", "description": "This is the format of the string. To pass a regex, use the `pattern` property instead.\n\nOpenAI documentation: https://platform.openai.com/docs/guides/structured-outputs?api-mode=chat&type-restrictions=string-restrictions", "enum": [ "date-time", "time", "date", "duration", "email", "hostname", "ipv4", "ipv6", "uuid" ] }, "required": { "type": "array", "description": "This is a list of properties that are required.\n\nThis only makes sense if the type is \"object\".", "items": { "type": "object" } }, "enum": { "type": "array", "description": "This array specifies the allowed values that can be used to restrict the output of the model.", "items": { "type": "object" } }, "title": { "type": "string", "description": "This is the title of the schema." } }, "required": [ "type" ] } ] } }, "required": [ "id", "orgId", "createdAt", "updatedAt", "name", "schema" ] }