Query Stream
/v1/query/streamHTTPBearerAuthorizationBearer <token>AskRAI API key
application/json- body
prompt*PromptUser query text
length <= 10000thread_id?|Conversation thread ID, a UUID of any version: its 32 hex digits in any case, hyphenated 8-4-4-4-12 or not, bare, in braces or after urn:uuid:. Generated if not provided. Kept as sent, so its session is read back under the same spelling.
execution_mode?|Execution mode to run under; must be one of the credential's allowed modes. Omit to use the least-augmenting one it allows.
A server-sent event stream. An answer arrives as a metadata event, its token events and a done event; one that found nothing, or was blocked before the model began answering, arrives as the done event alone. Every done event carries thread_id, which a follow-up sends to continue the conversation. A failure after the stream starts arrives as an error event whose data is {code, message}: UNAUTHORIZED, USER_BLOCKED, GUARDRAIL_UNEVALUABLE, INVALID_REQUEST or NO_MODEL_CONFIGURED, as the query route answers them; ORCHESTRATOR_ERROR, GATEWAY_TIMEOUT or SERVICE_UNAVAILABLE for a failure that can be retried.
text/event-streamcurl -X POST 'https://public.askrai.ai/v1/query/stream' \ -H 'Content-Type: application/json' \ -d '{ "prompt": "string"}'