> ## Documentation Index
> Fetch the complete documentation index at: https://www.voiceflow.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Knowledge bases

API operations for knowledge bases. Browse the routes below for parameters, request examples, and responses.

API version: Selected per operation

## Query knowledge base

Searches the knowledge base and returns the passages a retrieval would surface, which is how to see what an agent will be grounded on before it answers.

### Endpoint

```http
POST /v1/stable/knowledge-base/query
```

Server: https://realtime-api.voiceflow.com

### Authentication

```json
[
  {
    "token": []
  }
]
```

`token`:

```json
{
  "scheme": "bearer",
  "bearerFormat": "JWT",
  "type": "http",
  "description": "Voiceflow bearer token"
}
```

### Query parameters

#### `projectID`

Required · string

The ID of the project to operate on.

```json
{
  "type": "string",
  "description": "The ID of the project to operate on."
}
```

#### `environmentAlias`

Required · string

The alias of the environment to operate on (e.g. `main`).

```json
{
  "type": "string",
  "description": "The alias of the environment to operate on (e.g. `main`)."
}
```

### Request body

Required

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/StableKnowledgeBaseQueryRequest"
      }
    }
  }
}
```

### Responses

#### 200

Returns the answer generated from the knowledge base and the chunks it was drawn from, alongside the model used, the duration, and the token accounting for the call.

Schema:

```json
{
  "$ref": "#/components/schemas/StableKnowledgeBaseQueryResponse"
}
```

Example:

```json
{
  "answer": {
    "model": "gpt-3.5-turbo-1106",
    "output": "<string>",
    "tokens": 0,
    "duration": 0,
    "queryTokens": 0,
    "answerTokens": 0,
    "inputMultiplier": 0,
    "cacheMultiplier": 0,
    "outputMultiplier": 0,
    "cacheWriteTokens": 0,
    "queryCachedTokens": 0,
    "cacheWriteMultiplier": 0,
    "queryRemainderTokens": 0,
    "base": {
      "queryTokens": 0,
      "answerTokens": 0,
      "cacheWriteTokens": 0,
      "queryCachedTokens": 0
    },
    "priorityMultipliers": {
      "inputMultiplier": 0,
      "cacheMultiplier": 0,
      "outputMultiplier": 0,
      "cacheWriteMultiplier": 0
    },
    "chunks": [
      {
        "score": 0,
        "chunkID": "<string>",
        "documentID": "<string>",
        "content": "<string>",
        "source": "<KBDocumentData>",
        "metadata": {}
      }
    ]
  }
}
```

### Request examples

#### cURL

```bash
curl --request POST \
  --url 'https://realtime-api.voiceflow.com/v1/stable/knowledge-base/query?projectID=<projectID>&environmentAlias=<environmentAlias>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "version": "draft",
  "filters": {},
  "question": "<string>",
  "settings": {
    "model": "gpt-3.5-turbo-1106",
    "system": "<string>",
    "maxTokens": 0,
    "temperature": 0,
    "reasoningEffort": "off"
  },
  "synthesis": true,
  "chunkLimit": 0,
  "instruction": "<string>"
}'
```

#### JavaScript

```javascript
const response = await fetch('https://realtime-api.voiceflow.com/v1/stable/knowledge-base/query?projectID=<projectID>&environmentAlias=<environmentAlias>', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "version": "draft",
    "filters": {},
    "question": "<string>",
    "settings": {
      "model": "gpt-3.5-turbo-1106",
      "system": "<string>",
      "maxTokens": 0,
      "temperature": 0,
      "reasoningEffort": "off"
    },
    "synthesis": true,
    "chunkLimit": 0,
    "instruction": "<string>"
  }),
});
const data = await response.json();
```

#### Python

```python
import requests

response = requests.post(
    'https://realtime-api.voiceflow.com/v1/stable/knowledge-base/query?projectID=<projectID>&environmentAlias=<environmentAlias>',
    headers={'Authorization': 'Bearer <token>'},
    json={
      "version": "draft",
      "filters": {},
      "question": "<string>",
      "settings": {
        "model": "gpt-3.5-turbo-1106",
        "system": "<string>",
        "maxTokens": 0,
        "temperature": 0,
        "reasoningEffort": "off"
      },
      "synthesis": True,
      "chunkLimit": 0,
      "instruction": "<string>"
    },
)
data = response.json()
```

#### Voiceflow CLI

```bash
vf knowledge-base query --project-id <projectID> --environment-alias <environmentAlias> <<'JSON'
{
  "version": "draft",
  "filters": {},
  "question": "<string>",
  "settings": {
    "model": "gpt-3.5-turbo-1106",
    "system": "<string>",
    "maxTokens": 0,
    "temperature": 0,
    "reasoningEffort": "off"
  },
  "synthesis": true,
  "chunkLimit": 0,
  "instruction": "<string>"
}
JSON
```


## Schema definitions

### KBDocumentCSVData

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "csv"
      ],
      "x-enumNames": [
        "CSV"
      ]
    },
    "name": {
      "type": "string"
    },
    "rowsCount": {
      "type": "number"
    },
    "url": {
      "nullable": true,
      "type": "string"
    }
  },
  "required": [
    "type",
    "name"
  ]
}
```

### KBDocumentData

```json
{
  "oneOf": [
    {
      "$ref": "#/components/schemas/KBDocumentUrlData"
    },
    {
      "$ref": "#/components/schemas/KBDocumentDocxData"
    },
    {
      "$ref": "#/components/schemas/KBDocumentPDFData"
    },
    {
      "$ref": "#/components/schemas/KBDocumentTextData"
    },
    {
      "$ref": "#/components/schemas/KBDocumentMarkdownData"
    },
    {
      "$ref": "#/components/schemas/KBDocumentCSVData"
    },
    {
      "$ref": "#/components/schemas/KBDocumentXLSXData"
    },
    {
      "$ref": "#/components/schemas/KBDocumentTableData"
    },
    {
      "$ref": "#/components/schemas/KBDocumentSitemapData"
    },
    {
      "$ref": "#/components/schemas/KBDocumentIntegrationData"
    }
  ]
}
```

### KBDocumentDocxData

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "docx"
      ],
      "x-enumNames": [
        "DOCX"
      ]
    },
    "name": {
      "type": "string"
    },
    "url": {
      "nullable": true,
      "type": "string"
    }
  },
  "required": [
    "type",
    "name"
  ]
}
```

### KBDocumentIntegrationConfig

```json
{
  "type": "object",
  "properties": {
    "filters": {
      "type": "object",
      "additionalProperties": {}
    },
    "preserveStructure": {
      "type": "boolean"
    },
    "importMetadata": {
      "type": "boolean"
    },
    "connection": {
      "type": "object",
      "properties": {
        "fingerprint": {
          "type": "string"
        }
      },
      "required": [
        "fingerprint"
      ]
    },
    "exclude": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "name"
        ]
      }
    }
  },
  "required": [
    "filters",
    "preserveStructure",
    "importMetadata",
    "connection",
    "exclude"
  ]
}
```

### KBDocumentIntegrationData

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "integration"
      ],
      "x-enumNames": [
        "INTEGRATION"
      ]
    },
    "name": {
      "type": "string"
    },
    "source": {
      "$ref": "#/components/schemas/KnowledgeBaseDocumentIntegrationType"
    },
    "config": {
      "$ref": "#/components/schemas/KBDocumentIntegrationConfig"
    },
    "refreshRate": {
      "allOf": [
        {
          "$ref": "#/components/schemas/KnowledgeBaseDocumentRefreshRate"
        }
      ]
    },
    "lastSuccessUpdate": {
      "type": "string"
    },
    "sync": {
      "nullable": true,
      "allOf": [
        {
          "$ref": "#/components/schemas/KBDocumentSitemapSync"
        }
      ]
    }
  },
  "required": [
    "type",
    "name",
    "source",
    "config"
  ]
}
```

### KBDocumentMarkdownData

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "md"
      ],
      "x-enumNames": [
        "MD"
      ]
    },
    "name": {
      "type": "string"
    },
    "url": {
      "nullable": true,
      "type": "string"
    }
  },
  "required": [
    "type",
    "name"
  ]
}
```

### KBDocumentPDFData

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "pdf"
      ],
      "x-enumNames": [
        "PDF"
      ]
    },
    "name": {
      "type": "string"
    },
    "url": {
      "nullable": true,
      "type": "string"
    }
  },
  "required": [
    "type",
    "name"
  ]
}
```

### KBDocumentSitemapData

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "sitemap"
      ],
      "x-enumNames": [
        "SITEMAP"
      ]
    },
    "name": {
      "type": "string"
    },
    "url": {
      "type": "string"
    },
    "refreshRate": {
      "allOf": [
        {
          "$ref": "#/components/schemas/KnowledgeBaseDocumentRefreshRate"
        }
      ]
    },
    "refreshTime": {
      "nullable": true,
      "type": "string",
      "pattern": "^([01]\\d|2[0-3]):(00|30)$"
    },
    "refreshTimezone": {
      "nullable": true,
      "type": "string"
    },
    "lastSuccessUpdate": {
      "type": "string"
    },
    "lastRefreshScheduledFor": {
      "nullable": true,
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
    },
    "patterns": {
      "allOf": [
        {
          "$ref": "#/components/schemas/KBDocumentSitemapPatterns"
        }
      ]
    },
    "sync": {
      "nullable": true,
      "allOf": [
        {
          "$ref": "#/components/schemas/KBDocumentSitemapSync"
        }
      ]
    }
  },
  "required": [
    "type",
    "name",
    "url"
  ]
}
```

### KBDocumentSitemapPatterns

```json
{
  "type": "object",
  "properties": {
    "include": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "exclude": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "include",
    "exclude"
  ]
}
```

### KBDocumentSitemapSync

```json
{
  "type": "object",
  "properties": {
    "syncedAt": {
      "type": "string"
    },
    "startedAt": {
      "nullable": true,
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
    },
    "addedCount": {
      "type": "number"
    },
    "removedCount": {
      "type": "number"
    },
    "failure": {
      "nullable": true,
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "at": {
          "type": "string"
        },
        "code": {
          "allOf": [
            {
              "$ref": "#/components/schemas/KBDocumentSitemapSyncFailureCode"
            }
          ]
        }
      },
      "required": [
        "message",
        "at"
      ]
    }
  },
  "required": [
    "syncedAt",
    "addedCount",
    "removedCount"
  ]
}
```

### KBDocumentSitemapSyncFailureCode

```json
{
  "type": "string",
  "enum": [
    "documentLimit",
    "integrationDisconnected",
    "integrationUnauthorized",
    "integrationAccountChanged",
    "rateLimited"
  ],
  "x-enumNames": [
    "DOCUMENT_LIMIT",
    "INTEGRATION_DISCONNECTED",
    "INTEGRATION_UNAUTHORIZED",
    "INTEGRATION_ACCOUNT_CHANGED",
    "RATE_LIMITED"
  ]
}
```

### KBDocumentTableData

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "table"
      ],
      "x-enumNames": [
        "TABLE"
      ]
    },
    "name": {
      "type": "string"
    },
    "rowsCount": {
      "type": "number"
    },
    "url": {
      "nullable": true,
      "type": "string"
    }
  },
  "required": [
    "type",
    "name",
    "rowsCount"
  ]
}
```

### KBDocumentTextData

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "text"
      ],
      "x-enumNames": [
        "TEXT"
      ]
    },
    "name": {
      "type": "string"
    },
    "canEdit": {
      "type": "boolean"
    },
    "url": {
      "nullable": true,
      "type": "string"
    }
  },
  "required": [
    "type",
    "name"
  ]
}
```

### KBDocumentUrlData

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "url"
      ],
      "x-enumNames": [
        "URL"
      ]
    },
    "name": {
      "type": "string"
    },
    "url": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "refreshRate": {
      "allOf": [
        {
          "$ref": "#/components/schemas/KnowledgeBaseDocumentRefreshRate"
        }
      ]
    },
    "refreshTime": {
      "nullable": true,
      "type": "string",
      "pattern": "^([01]\\d|2[0-3]):(00|30)$"
    },
    "refreshTimezone": {
      "nullable": true,
      "type": "string"
    },
    "lastSuccessUpdate": {
      "type": "string"
    },
    "lastRefreshScheduledFor": {
      "nullable": true,
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
    },
    "contentChangedAt": {
      "type": "string"
    },
    "accessTokenID": {
      "type": "number"
    },
    "integrationExternalID": {
      "type": "string"
    },
    "source": {
      "allOf": [
        {
          "$ref": "#/components/schemas/KnowledgeBaseDocumentIntegrationType"
        }
      ]
    },
    "sitemapDocumentID": {
      "nullable": true,
      "type": "string"
    },
    "integrationDocumentID": {
      "nullable": true,
      "type": "string"
    },
    "integrationPath": {
      "nullable": true,
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "type",
    "name",
    "url"
  ]
}
```

### KBDocumentXLSXData

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "xlsx"
      ],
      "x-enumNames": [
        "XLSX"
      ]
    },
    "name": {
      "type": "string"
    },
    "rowsCount": {
      "type": "number"
    },
    "url": {
      "nullable": true,
      "type": "string"
    }
  },
  "required": [
    "type",
    "name"
  ]
}
```

### KnowledgeBaseDocumentIntegrationType

```json
{
  "type": "string",
  "enum": [
    "zendesk",
    "shopify",
    "kustomer"
  ],
  "x-enumNames": [
    "ZENDESK",
    "SHOPIFY",
    "KUSTOMER"
  ]
}
```

### KnowledgeBaseDocumentRefreshRate

```json
{
  "type": "string",
  "enum": [
    "daily",
    "weekly",
    "monthly",
    "never"
  ],
  "x-enumNames": [
    "DAILY",
    "WEEKLY",
    "MONTHLY",
    "NEVER"
  ]
}
```

### StableKnowledgeBaseQueryRequest

```json
{
  "type": "object",
  "properties": {
    "version": {
      "type": "string",
      "enum": [
        "draft",
        "published"
      ],
      "description": "Whether to query the draft or the published version of the knowledge base.",
      "x-enumNames": [
        "DRAFT",
        "PUBLISHED"
      ]
    },
    "filters": {
      "description": "Metadata filters used to narrow down which document chunks are searched.",
      "type": "object",
      "additionalProperties": {}
    },
    "question": {
      "type": "string",
      "description": "The natural-language question to ask the knowledge base."
    },
    "settings": {
      "allOf": [
        {
          "$ref": "#/components/schemas/StableKnowledgeBaseQuerySettings"
        }
      ]
    },
    "synthesis": {
      "description": "Whether to synthesize an answer from the retrieved chunks; when false, only raw chunks are returned.",
      "type": "boolean"
    },
    "chunkLimit": {
      "description": "The maximum number of document chunks to retrieve.",
      "type": "integer",
      "minimum": 1,
      "maximum": 30
    },
    "instruction": {
      "description": "An additional instruction applied when synthesizing the answer from the retrieved chunks.",
      "type": "string"
    }
  },
  "required": [
    "version",
    "question"
  ],
  "additionalProperties": false
}
```

### StableKnowledgeBaseQueryResponse

```json
{
  "type": "object",
  "properties": {
    "answer": {
      "type": "object",
      "properties": {
        "model": {
          "type": "string",
          "enum": [
            "gpt-3.5-turbo-1106",
            "gpt-3.5-turbo",
            "gpt-4",
            "gpt-4o",
            "gpt-4o-mini",
            "gpt-4.1-2025-04-14",
            "gpt-4.1-mini-2025-04-14",
            "gpt-4.1-nano-2025-04-14",
            "gpt-o3-mini",
            "o3-2025-04-16",
            "o4-mini-2025-04-16",
            "gpt-5",
            "gpt-5-mini",
            "gpt-5-nano",
            "gpt-5.2",
            "gpt-5.4",
            "gpt-5.4-mini",
            "gpt-5.5",
            "gpt-5.6-sol",
            "gpt-5.6-terra",
            "gpt-5.6-luna",
            "gpt-6-sol",
            "gpt-6-luna",
            "gpt-6.1-sol",
            "gpt-realtime",
            "gpt-live-1",
            "claude-4-opus",
            "claude-4-sonnet",
            "claude-4.5-sonnet",
            "claude-4.6-sonnet",
            "claude-4.5-haiku",
            "claude-4.5-opus",
            "claude-4.7-opus",
            "bedrock-claude-4-sonnet",
            "bedrock-claude-4.5-sonnet",
            "bedrock-claude-4.6-sonnet",
            "bedrock-claude-5-sonnet",
            "bedrock-claude-5.5-sonnet",
            "bedrock-claude-4.5-haiku",
            "bedrock-claude-5.5-haiku",
            "bedrock-claude-4.5-opus",
            "bedrock-claude-4.7-opus",
            "bedrock-claude-4.8-opus",
            "voiceflow-core-4.0",
            "voiceflow-core-4.1",
            "voiceflow-core-4.2",
            "voiceflow-flash-4.2",
            "gemini-2.5-pro",
            "gemini-2.5-flash",
            "gemini-live-2.5-flash",
            "gemini-3-flash",
            "gemini-3.5-flash",
            "gemini-3.1-pro",
            "gpt-oss-20b",
            "gpt-oss-120b",
            "llama-guard-4",
            "llama-3.1-instant",
            "llama-3.3-versatile",
            "qwen3.6-27b",
            "grok-4.6",
            "voiceflow-flash-4.1",
            "kimi-k3",
            "gemini-flash-2",
            "gpt-4-turbo",
            "claude-3.5-haiku",
            "claude-3-opus",
            "claude-3.7-sonnet",
            "claude-v2",
            "llama-3.2-1b-preview",
            "gemini-pro-1.5",
            "claude-3-haiku",
            "claude-3-sonnet",
            "text-davinci-003",
            "claude-v1",
            "claude-instant-v1",
            "deep-seek-r1-distill-llama-70B",
            "claude-3.5-sonnet"
          ],
          "description": "The AI model used to answer the query.",
          "x-enumNames": [
            "GPT_3_5_TURBO_1106",
            "GPT_3_5_TURBO",
            "GPT_4",
            "GPT_4_O",
            "GPT_4_O_MINI",
            "GPT_4_1",
            "GPT_4_1_MINI",
            "GPT_4_1_NANO",
            "GPT_O_3_MINI",
            "GPT_O_3",
            "GPT_O_4_MINI",
            "GPT_5",
            "GPT_5_MINI",
            "GPT_5_NANO",
            "GPT_5_2",
            "GPT_5_4",
            "GPT_5_4_MINI",
            "GPT_5_5",
            "GPT_5_6_SOL",
            "GPT_5_6_TERRA",
            "GPT_5_6_LUNA",
            "GPT_6_SOL",
            "GPT_6_LUNA",
            "GPT_6_1_SOL",
            "GPT_REALTIME",
            "GPT_LIVE_1",
            "CLAUDE_4_OPUS",
            "CLAUDE_4_SONNET",
            "CLAUDE_4_5_SONNET",
            "CLAUDE_4_6_SONNET",
            "CLAUDE_4_5_HAIKU",
            "CLAUDE_4_5_OPUS",
            "CLAUDE_4_7_OPUS",
            "BEDROCK_CLAUDE_4_SONNET",
            "BEDROCK_CLAUDE_4_5_SONNET",
            "BEDROCK_CLAUDE_4_6_SONNET",
            "BEDROCK_CLAUDE_5_SONNET",
            "BEDROCK_CLAUDE_5_5_SONNET",
            "BEDROCK_CLAUDE_4_5_HAIKU",
            "BEDROCK_CLAUDE_5_5_HAIKU",
            "BEDROCK_CLAUDE_4_5_OPUS",
            "BEDROCK_CLAUDE_4_7_OPUS",
            "BEDROCK_CLAUDE_4_8_OPUS",
            "VOICEFLOW_CORE_4_0",
            "VOICEFLOW_CORE_4_1",
            "VOICEFLOW_CORE_4_2",
            "VOICEFLOW_FLASH_4_2",
            "GEMINI_2_5_PRO",
            "GEMINI_2_5_FLASH",
            "GEMINI_LIVE_2_5_FLASH",
            "GEMINI_3_FLASH",
            "GEMINI_3_5_FLASH",
            "GEMINI_3_1_PRO",
            "GPT_OSS_20_B",
            "GPT_OSS_120_B",
            "LLAMA_GUARD_4",
            "LLAMA_3_1_INSTANT",
            "LLAMA_3_3_VERSATILE",
            "QWEN_3_6_27_B",
            "GROK_4_6",
            "VOICEFLOW_FLASH_4_1",
            "KIMI_K_3",
            "GEMINI_FLASH_2",
            "GPT_4_TURBO",
            "CLAUDE_3_5_HAIKU",
            "CLAUDE_3_OPUS",
            "CLAUDE_3_7_SONNET",
            "CLAUDE_V_2",
            "LLAMA_3_2_1_B_PREVIEW",
            "GEMINI_PRO_1_5",
            "CLAUDE_3_HAIKU",
            "CLAUDE_3_SONNET",
            "DA_VINCI_003",
            "CLAUDE_V_1",
            "CLAUDE_INSTANT_V_1",
            "DEEP_SEEK_R_1_DISTILL_LLAMA_70_B",
            "CLAUDE_3_5_SONNET"
          ]
        },
        "output": {
          "nullable": true,
          "description": "The synthesized answer text, or `null` when no answer was generated.",
          "type": "string"
        },
        "tokens": {
          "type": "number",
          "description": "The total number of tokens consumed by the query."
        },
        "duration": {
          "type": "number",
          "description": "The time it took to execute the query."
        },
        "queryTokens": {
          "type": "number",
          "description": "The number of input tokens consumed by the query, after multipliers."
        },
        "answerTokens": {
          "type": "number",
          "description": "The number of output tokens consumed by the answer, after multipliers."
        },
        "inputMultiplier": {
          "type": "number",
          "description": "The billing multiplier applied to input tokens."
        },
        "cacheMultiplier": {
          "type": "number",
          "description": "The billing multiplier applied to cached input tokens."
        },
        "outputMultiplier": {
          "type": "number",
          "description": "The billing multiplier applied to output tokens."
        },
        "cacheWriteTokens": {
          "type": "number",
          "description": "The number of input tokens written to the prompt cache."
        },
        "queryCachedTokens": {
          "type": "number",
          "description": "The number of input tokens read from the prompt cache."
        },
        "cacheWriteMultiplier": {
          "type": "number",
          "description": "The billing multiplier applied to cache-write tokens."
        },
        "queryRemainderTokens": {
          "type": "number",
          "description": "The number of input tokens that were not served from the prompt cache."
        },
        "base": {
          "type": "object",
          "properties": {
            "queryTokens": {
              "type": "number",
              "description": "The raw number of input tokens consumed by the query."
            },
            "answerTokens": {
              "type": "number",
              "description": "The raw number of output tokens consumed by the answer."
            },
            "cacheWriteTokens": {
              "type": "number",
              "description": "The raw number of input tokens written to the prompt cache."
            },
            "queryCachedTokens": {
              "type": "number",
              "description": "The raw number of input tokens read from the prompt cache."
            }
          },
          "required": [
            "queryTokens",
            "answerTokens",
            "cacheWriteTokens",
            "queryCachedTokens"
          ],
          "description": "The raw token counts before billing multipliers are applied."
        },
        "priorityMultipliers": {
          "description": "The billing multipliers applied when the query runs with priority processing.",
          "type": "object",
          "properties": {
            "inputMultiplier": {
              "type": "number",
              "description": "The priority billing multiplier applied to input tokens."
            },
            "cacheMultiplier": {
              "type": "number",
              "description": "The priority billing multiplier applied to cached input tokens."
            },
            "outputMultiplier": {
              "type": "number",
              "description": "The priority billing multiplier applied to output tokens."
            },
            "cacheWriteMultiplier": {
              "type": "number",
              "description": "The priority billing multiplier applied to cache-write tokens."
            }
          },
          "required": [
            "inputMultiplier",
            "cacheMultiplier",
            "outputMultiplier",
            "cacheWriteMultiplier"
          ]
        },
        "chunks": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "score": {
                "type": "number"
              },
              "chunkID": {
                "type": "string"
              },
              "documentID": {
                "type": "string"
              },
              "content": {
                "type": "string"
              },
              "source": {
                "$ref": "#/components/schemas/KBDocumentData"
              },
              "metadata": {
                "type": "object",
                "additionalProperties": {}
              }
            },
            "required": [
              "score",
              "chunkID",
              "documentID",
              "content",
              "source",
              "metadata"
            ]
          }
        }
      },
      "required": [
        "model",
        "output",
        "tokens",
        "duration",
        "queryTokens",
        "answerTokens",
        "inputMultiplier",
        "cacheMultiplier",
        "outputMultiplier",
        "cacheWriteTokens",
        "queryCachedTokens",
        "cacheWriteMultiplier",
        "queryRemainderTokens",
        "base",
        "chunks"
      ],
      "description": "The result of the knowledge base query, including the synthesized answer and token usage."
    }
  },
  "required": [
    "answer"
  ]
}
```

### StableKnowledgeBaseQuerySettings

```json
{
  "type": "object",
  "properties": {
    "model": {
      "description": "The AI model used to synthesize the answer.",
      "type": "string",
      "enum": [
        "gpt-3.5-turbo-1106",
        "gpt-3.5-turbo",
        "gpt-4",
        "gpt-4o",
        "gpt-4o-mini",
        "gpt-4.1-2025-04-14",
        "gpt-4.1-mini-2025-04-14",
        "gpt-4.1-nano-2025-04-14",
        "gpt-o3-mini",
        "o3-2025-04-16",
        "o4-mini-2025-04-16",
        "gpt-5",
        "gpt-5-mini",
        "gpt-5-nano",
        "gpt-5.2",
        "gpt-5.4",
        "gpt-5.4-mini",
        "gpt-5.5",
        "gpt-5.6-sol",
        "gpt-5.6-terra",
        "gpt-5.6-luna",
        "gpt-6-sol",
        "gpt-6-luna",
        "gpt-6.1-sol",
        "gpt-realtime",
        "gpt-live-1",
        "claude-4-opus",
        "claude-4-sonnet",
        "claude-4.5-sonnet",
        "claude-4.6-sonnet",
        "claude-4.5-haiku",
        "claude-4.5-opus",
        "claude-4.7-opus",
        "bedrock-claude-4-sonnet",
        "bedrock-claude-4.5-sonnet",
        "bedrock-claude-4.6-sonnet",
        "bedrock-claude-5-sonnet",
        "bedrock-claude-5.5-sonnet",
        "bedrock-claude-4.5-haiku",
        "bedrock-claude-5.5-haiku",
        "bedrock-claude-4.5-opus",
        "bedrock-claude-4.7-opus",
        "bedrock-claude-4.8-opus",
        "voiceflow-core-4.0",
        "voiceflow-core-4.1",
        "voiceflow-core-4.2",
        "voiceflow-flash-4.2",
        "gemini-2.5-pro",
        "gemini-2.5-flash",
        "gemini-live-2.5-flash",
        "gemini-3-flash",
        "gemini-3.5-flash",
        "gemini-3.1-pro",
        "gpt-oss-20b",
        "gpt-oss-120b",
        "llama-guard-4",
        "llama-3.1-instant",
        "llama-3.3-versatile",
        "qwen3.6-27b",
        "grok-4.6",
        "voiceflow-flash-4.1",
        "kimi-k3",
        "gemini-flash-2",
        "gpt-4-turbo",
        "claude-3.5-haiku",
        "claude-3-opus",
        "claude-3.7-sonnet",
        "claude-v2",
        "llama-3.2-1b-preview",
        "gemini-pro-1.5",
        "claude-3-haiku",
        "claude-3-sonnet",
        "text-davinci-003",
        "claude-v1",
        "claude-instant-v1",
        "deep-seek-r1-distill-llama-70B",
        "claude-3.5-sonnet"
      ],
      "x-enumNames": [
        "GPT_3_5_TURBO_1106",
        "GPT_3_5_TURBO",
        "GPT_4",
        "GPT_4_O",
        "GPT_4_O_MINI",
        "GPT_4_1",
        "GPT_4_1_MINI",
        "GPT_4_1_NANO",
        "GPT_O_3_MINI",
        "GPT_O_3",
        "GPT_O_4_MINI",
        "GPT_5",
        "GPT_5_MINI",
        "GPT_5_NANO",
        "GPT_5_2",
        "GPT_5_4",
        "GPT_5_4_MINI",
        "GPT_5_5",
        "GPT_5_6_SOL",
        "GPT_5_6_TERRA",
        "GPT_5_6_LUNA",
        "GPT_6_SOL",
        "GPT_6_LUNA",
        "GPT_6_1_SOL",
        "GPT_REALTIME",
        "GPT_LIVE_1",
        "CLAUDE_4_OPUS",
        "CLAUDE_4_SONNET",
        "CLAUDE_4_5_SONNET",
        "CLAUDE_4_6_SONNET",
        "CLAUDE_4_5_HAIKU",
        "CLAUDE_4_5_OPUS",
        "CLAUDE_4_7_OPUS",
        "BEDROCK_CLAUDE_4_SONNET",
        "BEDROCK_CLAUDE_4_5_SONNET",
        "BEDROCK_CLAUDE_4_6_SONNET",
        "BEDROCK_CLAUDE_5_SONNET",
        "BEDROCK_CLAUDE_5_5_SONNET",
        "BEDROCK_CLAUDE_4_5_HAIKU",
        "BEDROCK_CLAUDE_5_5_HAIKU",
        "BEDROCK_CLAUDE_4_5_OPUS",
        "BEDROCK_CLAUDE_4_7_OPUS",
        "BEDROCK_CLAUDE_4_8_OPUS",
        "VOICEFLOW_CORE_4_0",
        "VOICEFLOW_CORE_4_1",
        "VOICEFLOW_CORE_4_2",
        "VOICEFLOW_FLASH_4_2",
        "GEMINI_2_5_PRO",
        "GEMINI_2_5_FLASH",
        "GEMINI_LIVE_2_5_FLASH",
        "GEMINI_3_FLASH",
        "GEMINI_3_5_FLASH",
        "GEMINI_3_1_PRO",
        "GPT_OSS_20_B",
        "GPT_OSS_120_B",
        "LLAMA_GUARD_4",
        "LLAMA_3_1_INSTANT",
        "LLAMA_3_3_VERSATILE",
        "QWEN_3_6_27_B",
        "GROK_4_6",
        "VOICEFLOW_FLASH_4_1",
        "KIMI_K_3",
        "GEMINI_FLASH_2",
        "GPT_4_TURBO",
        "CLAUDE_3_5_HAIKU",
        "CLAUDE_3_OPUS",
        "CLAUDE_3_7_SONNET",
        "CLAUDE_V_2",
        "LLAMA_3_2_1_B_PREVIEW",
        "GEMINI_PRO_1_5",
        "CLAUDE_3_HAIKU",
        "CLAUDE_3_SONNET",
        "DA_VINCI_003",
        "CLAUDE_V_1",
        "CLAUDE_INSTANT_V_1",
        "DEEP_SEEK_R_1_DISTILL_LLAMA_70_B",
        "CLAUDE_3_5_SONNET"
      ]
    },
    "system": {
      "description": "The system prompt applied to the model when synthesizing the answer.",
      "type": "string"
    },
    "maxTokens": {
      "description": "Deprecated. The model's default output limit applies when this is lower or unset, and the model's maximum caps it.",
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "temperature": {
      "description": "The sampling temperature applied to the model when synthesizing the answer.",
      "type": "number"
    },
    "reasoningEffort": {
      "description": "The reasoning effort applied to the model when synthesizing the answer.",
      "type": "string",
      "enum": [
        "off",
        "adaptive",
        "minimal",
        "low",
        "medium",
        "high"
      ],
      "x-enumNames": [
        "OFF",
        "ADAPTIVE",
        "MINIMAL",
        "LOW",
        "MEDIUM",
        "HIGH"
      ]
    }
  }
}
```
