Skip to content

Stream Answer

POST
/v1/answers/stream
curl --request POST \
--url https://api.uavcrew.ai/v1/answers/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "question": "example", "context": { "page": "example" }, "history": [ { "question": "example", "answer": "example" } ] }'

Stream one answer as Server-Sent Events.

Events: thinking (model reasoning, live), tool_call (corpus lookup), answer_delta (answer tokens), done ({answer, sources, thinking}), error. Same scope, validation, and statelessness as POST /v1/answers.

Media typeapplication/json
AnswerRequest
object
question
required
Question
string
>= 3 characters <= 2000 characters
context
Any of:
AnswerContext

Untrusted rendering hint from the caller’s site.

page biases framing only (“the user is on the Part 107 page”) — it filters nothing, so a forged hint can only ever yield regulatory answers from the public corpus.

object
page
Any of:
string
<= 60 characters
history
Any of:
Array<object>
<= 8 items
HistoryTurn

One prior Q&A pair, resent by the caller to give follow-ups context.

The endpoint stays stateless: the caller owns the thread and decides how much history (and therefore prompt cost) to resend.

object
question
required
Question
string
<= 1000 characters
answer
required
Answer
string
<= 4000 characters

Example generated

{
"question": "example",
"context": {
"page": "example"
},
"history": [
{
"question": "example",
"answer": "example"
}
]
}

Successful Response

Media typeapplication/json

Example generated

example

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object

Example generated

{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}