Stream an AI answer about current content
Emits sources, textDelta, and completed events over SSE. Uses the same inputs, permissions, AI credits, and rate limit as complete answers. Stream errors use SSE error frames. Never reconnect automatically.
Required API key permissions: ai-answers, read:entries, read:collections. Write permissions also grant read access for the same resource.
Authentication
apiKeyhttp, bearer, Andesine API keyUse an Andesine API key as a Bearer token
oauthhttp, bearer, Andesine OAuth access tokenUse an OAuth access token with andesine:api scope. Send x-workspace-id for workspace operations. Current user permissions apply.
Headers
x-workspace-idstringRequired for OAuth: ID of the workspace to access. API keys use their own workspace.
Request body *
application/jsonBodyobject6 fields
question*stringcollectionIDstringcollectionPathstringDecoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.
collectionSlugPathstringDecoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.
filtersarray of PropertyFilter[]Options
Any of
TextPropertyFilterobject
kind*constant"text"key*stringProperty identifier
operatorstring"any", "all", "none"Default: "any"values*array of stringNumberPropertyFilterobject
kind*constant"number"key*stringProperty identifier
operator*ComparisonOperator"equals", "notEquals", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual"value*numberBooleanPropertyFilterobject
kind*constant"boolean"key*stringProperty identifier
value*booleanDatePropertyFilterobject
kind*constant"date"key*stringProperty identifier
operator*ComparisonOperator"equals", "notEquals", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual"value*stringhistoryarray of AnswerHistoryMessage[]2 fields
role*string"user", "assistant"content*stringResponses
200OKtext/event-stream
Bodyone ofOptions
One of
Option 1object
event*constant"message"data*AnswerEventOptions
Any of
Option 1object
type*constant"sources"sources*array of AnswerSource16 fields
path*stringslugPath*stringanchorstringentryID*stringcollectionIDstringcollectionPath*array of stringheadingPath*array of stringtitle*stringsnippet*stringproperties*array of SearchPropertyValue7 fields
key*stringname*stringtype*EntryPropertyKind"text", "number", "checkbox", "date", "url", "select", "multi-select"textValuearray of stringnumberValuenumberbooleanValuebooleandateValuenumberupdatedAt*stringchannelPublishingChannelCodeversionIDstringsnapshotIDstringid*numberrelevance*numberOption 2object
type*constant"textDelta"text*stringOption 3object
answer*stringsources*array of AnswerSource16 fields
path*stringslugPath*stringanchorstringentryID*stringcollectionIDstringcollectionPath*array of stringheadingPath*array of stringtitle*stringsnippet*stringproperties*array of SearchPropertyValue7 fields
key*stringname*stringtype*EntryPropertyKind"text", "number", "checkbox", "date", "url", "select", "multi-select"textValuearray of stringnumberValuenumberbooleanValuebooleandateValuenumberupdatedAt*stringchannelPublishingChannelCodeversionIDstringsnapshotIDstringid*numberrelevance*numbertype*constant"completed"idstringretrynumberOption 2object
event*constant"done"dataanyidstringretrynumberOption 3object
event*constant"error"dataanyidstringretrynumber400Bad Requestapplication/json
Bodyone ofOptions
One of
Option 1object
defined*constanttruecode*constant"BAD_REQUEST"status*constant400message*string"Bad Request"dataValidationErrorData2 fields
hintsarray of stringSuggested next steps. Wording can change; use error codes and structured data for program logic.
issuesarray of ValidationIssue3 fields
message*stringcodestringpatharray of any ofOptions
Any of
Option 1string
Option 2number
Option 3object
key*any ofOptions
Any of
Option 1string
Option 2number
Option 2object
defined*constantfalsecode*stringstatus*numbermessage*stringdataany401Unauthorizedapplication/json
Bodyone ofOptions
One of
Option 1object
defined*constanttruecode*constant"UNAUTHORIZED"status*constant401message*string"Unauthorized"dataErrorData1 field
hintsarray of stringSuggested next steps. Wording can change; use error codes and structured data for program logic.
Option 2object
defined*constantfalsecode*stringstatus*numbermessage*stringdataany403Forbiddenapplication/json
Bodyone ofOptions
One of
Option 1object
defined*constanttruecode*constant"FORBIDDEN"status*constant403message*string"Forbidden"dataForbiddenErrorData4 fields
hintsarray of stringSuggested next steps. Wording can change; use error codes and structured data for program logic.
missingPermissionsarray of stringrequiredPlanconstant"pro"actionstringThe requested action that was denied
Option 2object
defined*constantfalsecode*stringstatus*numbermessage*stringdataany404Not Foundapplication/json
Bodyone ofOptions
One of
Option 1object
defined*constanttruecode*constant"NOT_FOUND"status*constant404message*string"Not Found"dataErrorData1 field
hintsarray of stringSuggested next steps. Wording can change; use error codes and structured data for program logic.
Option 2object
defined*constantfalsecode*stringstatus*numbermessage*stringdataany409Conflictapplication/json
Bodyone ofOptions
One of
Option 1object
defined*constanttruecode*constant"CONFLICT"status*constant409message*string"Conflict"dataErrorData1 field
hintsarray of stringSuggested next steps. Wording can change; use error codes and structured data for program logic.
Option 2object
defined*constantfalsecode*stringstatus*numbermessage*stringdataany429Too Many Requestsapplication/json
Bodyone ofOptions
One of
Option 1object
defined*constanttruecode*constant"TOO_MANY_REQUESTS"status*constant429message*string"Too Many Requests"dataRateLimitErrorData3 fields
hintsarray of stringSuggested next steps. Wording can change; use error codes and structured data for program logic.
limitstringThe limit that was reached: a short-term rate limit, or a monthly API call, AI credit, or spending limit
"rate", "api-calls", "ai-credits", "spending"retryAfterSecondsnumberMinimum delay before another attempt, in seconds. Also sent in Retry-After.
Option 2object
defined*constantfalsecode*stringstatus*numbermessage*stringdataany500Internal Server Errorapplication/json
Bodyone ofOptions
One of
Option 1object
defined*constanttruecode*constant"INTERNAL_SERVER_ERROR"status*constant500message*string"Internal Server Error"dataErrorData1 field
hintsarray of stringSuggested next steps. Wording can change; use error codes and structured data for program logic.
Option 2object
defined*constantfalsecode*stringstatus*numbermessage*stringdataany503Service Unavailableapplication/json
Bodyone ofOptions
One of
Option 1object
defined*constanttruecode*constant"SERVICE_UNAVAILABLE"status*constant503message*string"Service Unavailable"dataErrorData1 field
hintsarray of stringSuggested next steps. Wording can change; use error codes and structured data for program logic.
Option 2object
defined*constantfalsecode*stringstatus*numbermessage*stringdataany