Ask a question and receive the answer as Server-Sent Events while it is generated. Same body and rules as Send a message; only delivery differs.
POST
/
conversations
/
{conversation_id}
/
messages:stream
curl -N --request POST "$MITHUNAI_URL/mithunai/api/v1/conversations/c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60/messages:stream" \ --header "Authorization: Bearer $MITHUNAI_API_KEY" \ --header "Content-Type: application/json" \ --data '{"text": "How do I rotate an API key?", "idempotency_key": "ticket-4821-q1"}'
import json, os, requestsconversation_id = "c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60"url = f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/conversations/{conversation_id}/messages:stream"with requests.post( url, headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"}, json={"text": "How do I rotate an API key?", "idempotency_key": "ticket-4821-q1"}, stream=True, timeout=120,) as response: response.raise_for_status() # Refusals arrive here, before any event. event = None for line in response.iter_lines(decode_unicode=True): if line.startswith("event: "): event = line[len("event: "):] elif line.startswith("data: "): data = json.loads(line[len("data: "):]) if event == "answer.delta": print(data["text"], end="", flush=True) elif event == "answer.replaced": print(f"\n[replaced]\n{data['text']}", end="", flush=True) elif event == "answer.completed": print(f"\n[{data['status']}]") elif event in ("answer.interrupted", "answer.error"): print(f"\n[{event}] {data}")
const conversationId = 'c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60'const response = await fetch( `${process.env.MITHUNAI_URL}/mithunai/api/v1/conversations/${conversationId}/messages:stream`, { method: 'POST', headers: { Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ text: 'How do I rotate an API key?', idempotency_key: 'ticket-4821-q1', }), },)if (!response.ok) throw new Error(JSON.stringify(await response.json()))const reader = response.body.getReader()const decoder = new TextDecoder()let buffer = ''for (;;) { const { done, value } = await reader.read() if (done) break buffer += decoder.decode(value, { stream: true }) let boundary while ((boundary = buffer.indexOf('\n\n')) !== -1) { const record = buffer.slice(0, boundary) buffer = buffer.slice(boundary + 2) let event = '' let data = '' for (const line of record.split('\n')) { if (line.startsWith('event: ')) event = line.slice(7) else if (line.startsWith('data: ')) data = line.slice(6) } const payload = JSON.parse(data) if (event === 'answer.delta') process.stdout.write(payload.text) else if (event === 'answer.replaced') process.stdout.write(`\n[replaced]\n${payload.text}`) else if (event === 'answer.completed') console.log(`\n[${payload.status}]`) else if (event === 'answer.interrupted' || event === 'answer.error') console.log(`\n[${event}]`, payload) }}
id: 1event: message.createddata: {"answer_message_id":"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36","conversation_id":"c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60","user_message_id":"0e6b1d4f-8a27-4c93-b5d0-7f2e9a3c6b18"}id: 2event: answer.starteddata: {"answer_message_id":"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36"}id: 3event: answer.deltadata: {"text":"Mint a new key, move your integration to it, "}id: 4event: answer.sourcesdata: {"citations":[{"anchor":"rotation","ordinal":1,"score":0.82,"snippet":"Rotation is mint-then-revoke: create the replacement first, then revoke the old key.","source_id":"3d8f2a61-7e4b-4c19-9a05-b6e1d7c2f480","title":"Managing API keys","url":"https://docs.example.com/admin/api-keys#rotation"}]}id: 5event: answer.deltadata: {"text":"then revoke the old key [1]."}id: 6event: answer.sourcesdata: {"citations":[{"anchor":"rotation","ordinal":1,"score":0.82,"snippet":"Rotation is mint-then-revoke: create the replacement first, then revoke the old key.","source_id":"3d8f2a61-7e4b-4c19-9a05-b6e1d7c2f480","title":"Managing API keys","url":"https://docs.example.com/admin/api-keys#rotation"}]}id: 7event: answer.completeddata: {"abstained":false,"abstention_reason":null,"answer_message_id":"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36","finish_reason":"end_turn","status":"answered"}
id: 1event: message.createddata: {"answer_message_id":"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36","conversation_id":"c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60","user_message_id":"0e6b1d4f-8a27-4c93-b5d0-7f2e9a3c6b18"}id: 2event: answer.starteddata: {"answer_message_id":"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36"}id: 3event: answer.errordata: {"code":"provider_failure","message":"The upstream provider could not complete the request."}
{ "code": "conflict", "message": "This conversation is already waiting for an answer." }
{ "code": "quota_exceeded", "message": "The monthly answer limit for this account has been reached."}
{ "code": "not_found", "message": "The requested resource was not found." }
This runs the same turn as Send a message, with the same request body and the same rules: one question at a time, only the owner can ask, archived conversations refuse questions, and idempotency_key makes retries safe. The difference is delivery. The answer arrives as a text/event-stream response. See Streaming for a walkthrough.Refusals arrive before the stream opens. Authentication, validation, permission checks and the one-turn-at-a-time claim all run first. If any of them fails, you get an ordinary HTTP error with a JSON body (400, 401, 403, 404, 409 or 429) and no stream. That includes 429 with the code quota_exceeded when your organisation has used its monthly answer allowance; it is never an event on an open stream.While a question is in progress, another one returns 409. A question left unanswered for more than 15 minutes, because the server handling it stopped, no longer blocks the conversation: the next question takes over and the lost answer is marked interrupted.This request also resolves the conversation’s assistant. If that assistant can no longer answer (it is disabled or archived, or has no knowledge attached), this request returns 400validation_error.
A 200 does not mean the answer succeeded. Once the stream opens, a failure is reported as a
terminal answer.error event on the 200 response. Always read the terminal event.
If you retry with an idempotency_key whose turn has already finished, the stored turn is replayed as a stream: message.created, answer.started, the full answer text in one answer.delta, its answer.sources if it has citations, and a terminal event matching how the turn ended. The model is not asked again. A replayed turn that had failed ends with answer.error: send a new key to ask again.If you disconnect, the answer is saved with whatever text was produced and marked interrupted, and the conversation is freed for the next question. Streams cannot be resumed and Last-Event-ID is not supported; read the answer back with List messages.
The question. 1 to 16,000 characters after trimming. Newlines and tabs are allowed; other control
characters and invisible formatting characters are rejected.
Your own labels for the question. At most 20 entries; keys up to 64 characters matching
^[a-z][a-z0-9_.-]*$; values up to 512 characters on a single line.
The citations the answer uses so far. A new answer.sources is sent whenever the answer first cites another source, and it always arrives before the answer.delta containing that source’s [n] marker, so every marker you render can be linked immediately. Each event carries the full list, so replace your citation list rather than appending to it.When the answer has citations, a final answer.sources with the complete list is sent just before answer.completed. If the assistant abstains after sources were sent, a final answer.sources with an empty citations list clears them.
Identifier of the cited passage. It stays the same while the document’s content is unchanged
and changes when changed content is re-ingested. It is not a knowledge source ID or a document
ID.
The answer’s final checks withdrew or rewrote the text already streamed, for example turning an answer that did not cite its sources into an abstention, or removing a link that could not be verified. Discard every answer.delta you have received and show this text instead. Later deltas, if any, append to it. The stored message holds only the final text.
Why the assistant declined, or null when it declined without naming a reason. Always null when
abstained is false.An open string: match the values you know and fall back to a generic notice for one you do not.
New values are not a breaking change.
Value
What it means
What changes it
no_evidence
Nothing came back from your sources at all.
Connect a source that covers the subject.
below_score_threshold
Passages came back; none was a close enough match.
A source that covers it directly, or a lower grounding threshold.
weak_best_match
Passages cleared the floor, but the closest was still only loosely related.
A more specific question, or better coverage.
too_few_passages
Fewer passages cleared the bar than the assistant answers from.
Coverage in more than one place, or a lower minimum.
model_declined
The passages passed the gate and the model still judged them insufficient.
Reword, or improve the source. A retrieval-quality signal, not a coverage gap.
no_supporting_citation
A draft answer cited no real passage, so it was withheld.
Nothing on your side — the grounding check working.
unverified_link
The draft contained a link that appears in none of the cited passages.
Same.
provider_filtered
The model provider declined to produce output.
Reword, or retry.
empty_generation
The provider returned nothing.
Retry.
The widget surface receives a deliberately coarser set — see
Stream a thread message.This is a streaming field only: a message read back from
List messages carries abstained but no reason, and a
replayed idempotent turn sends null.
Generation produced some text and then stopped early. The partial answer is saved with statusinterrupted. You have text to show, but it is not a complete answer.
Why it stopped: an error code such as provider_failure when generation failed part-way,
incomplete_stream when generation ended without finishing, or interrupted on a replayed turn.
A client-safe message. It never contains internal detail.
curl -N --request POST "$MITHUNAI_URL/mithunai/api/v1/conversations/c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60/messages:stream" \ --header "Authorization: Bearer $MITHUNAI_API_KEY" \ --header "Content-Type: application/json" \ --data '{"text": "How do I rotate an API key?", "idempotency_key": "ticket-4821-q1"}'
import json, os, requestsconversation_id = "c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60"url = f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/conversations/{conversation_id}/messages:stream"with requests.post( url, headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"}, json={"text": "How do I rotate an API key?", "idempotency_key": "ticket-4821-q1"}, stream=True, timeout=120,) as response: response.raise_for_status() # Refusals arrive here, before any event. event = None for line in response.iter_lines(decode_unicode=True): if line.startswith("event: "): event = line[len("event: "):] elif line.startswith("data: "): data = json.loads(line[len("data: "):]) if event == "answer.delta": print(data["text"], end="", flush=True) elif event == "answer.replaced": print(f"\n[replaced]\n{data['text']}", end="", flush=True) elif event == "answer.completed": print(f"\n[{data['status']}]") elif event in ("answer.interrupted", "answer.error"): print(f"\n[{event}] {data}")
const conversationId = 'c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60'const response = await fetch( `${process.env.MITHUNAI_URL}/mithunai/api/v1/conversations/${conversationId}/messages:stream`, { method: 'POST', headers: { Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ text: 'How do I rotate an API key?', idempotency_key: 'ticket-4821-q1', }), },)if (!response.ok) throw new Error(JSON.stringify(await response.json()))const reader = response.body.getReader()const decoder = new TextDecoder()let buffer = ''for (;;) { const { done, value } = await reader.read() if (done) break buffer += decoder.decode(value, { stream: true }) let boundary while ((boundary = buffer.indexOf('\n\n')) !== -1) { const record = buffer.slice(0, boundary) buffer = buffer.slice(boundary + 2) let event = '' let data = '' for (const line of record.split('\n')) { if (line.startsWith('event: ')) event = line.slice(7) else if (line.startsWith('data: ')) data = line.slice(6) } const payload = JSON.parse(data) if (event === 'answer.delta') process.stdout.write(payload.text) else if (event === 'answer.replaced') process.stdout.write(`\n[replaced]\n${payload.text}`) else if (event === 'answer.completed') console.log(`\n[${payload.status}]`) else if (event === 'answer.interrupted' || event === 'answer.error') console.log(`\n[${event}]`, payload) }}
id: 1event: message.createddata: {"answer_message_id":"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36","conversation_id":"c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60","user_message_id":"0e6b1d4f-8a27-4c93-b5d0-7f2e9a3c6b18"}id: 2event: answer.starteddata: {"answer_message_id":"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36"}id: 3event: answer.deltadata: {"text":"Mint a new key, move your integration to it, "}id: 4event: answer.sourcesdata: {"citations":[{"anchor":"rotation","ordinal":1,"score":0.82,"snippet":"Rotation is mint-then-revoke: create the replacement first, then revoke the old key.","source_id":"3d8f2a61-7e4b-4c19-9a05-b6e1d7c2f480","title":"Managing API keys","url":"https://docs.example.com/admin/api-keys#rotation"}]}id: 5event: answer.deltadata: {"text":"then revoke the old key [1]."}id: 6event: answer.sourcesdata: {"citations":[{"anchor":"rotation","ordinal":1,"score":0.82,"snippet":"Rotation is mint-then-revoke: create the replacement first, then revoke the old key.","source_id":"3d8f2a61-7e4b-4c19-9a05-b6e1d7c2f480","title":"Managing API keys","url":"https://docs.example.com/admin/api-keys#rotation"}]}id: 7event: answer.completeddata: {"abstained":false,"abstention_reason":null,"answer_message_id":"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36","finish_reason":"end_turn","status":"answered"}
id: 1event: message.createddata: {"answer_message_id":"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36","conversation_id":"c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60","user_message_id":"0e6b1d4f-8a27-4c93-b5d0-7f2e9a3c6b18"}id: 2event: answer.starteddata: {"answer_message_id":"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36"}id: 3event: answer.errordata: {"code":"provider_failure","message":"The upstream provider could not complete the request."}
{ "code": "conflict", "message": "This conversation is already waiting for an answer." }
{ "code": "quota_exceeded", "message": "The monthly answer limit for this account has been reached."}
{ "code": "not_found", "message": "The requested resource was not found." }
Last modified on November 7, 2026
curl -N --request POST "$MITHUNAI_URL/mithunai/api/v1/conversations/c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60/messages:stream" \ --header "Authorization: Bearer $MITHUNAI_API_KEY" \ --header "Content-Type: application/json" \ --data '{"text": "How do I rotate an API key?", "idempotency_key": "ticket-4821-q1"}'
import json, os, requestsconversation_id = "c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60"url = f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/conversations/{conversation_id}/messages:stream"with requests.post( url, headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"}, json={"text": "How do I rotate an API key?", "idempotency_key": "ticket-4821-q1"}, stream=True, timeout=120,) as response: response.raise_for_status() # Refusals arrive here, before any event. event = None for line in response.iter_lines(decode_unicode=True): if line.startswith("event: "): event = line[len("event: "):] elif line.startswith("data: "): data = json.loads(line[len("data: "):]) if event == "answer.delta": print(data["text"], end="", flush=True) elif event == "answer.replaced": print(f"\n[replaced]\n{data['text']}", end="", flush=True) elif event == "answer.completed": print(f"\n[{data['status']}]") elif event in ("answer.interrupted", "answer.error"): print(f"\n[{event}] {data}")
const conversationId = 'c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60'const response = await fetch( `${process.env.MITHUNAI_URL}/mithunai/api/v1/conversations/${conversationId}/messages:stream`, { method: 'POST', headers: { Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ text: 'How do I rotate an API key?', idempotency_key: 'ticket-4821-q1', }), },)if (!response.ok) throw new Error(JSON.stringify(await response.json()))const reader = response.body.getReader()const decoder = new TextDecoder()let buffer = ''for (;;) { const { done, value } = await reader.read() if (done) break buffer += decoder.decode(value, { stream: true }) let boundary while ((boundary = buffer.indexOf('\n\n')) !== -1) { const record = buffer.slice(0, boundary) buffer = buffer.slice(boundary + 2) let event = '' let data = '' for (const line of record.split('\n')) { if (line.startsWith('event: ')) event = line.slice(7) else if (line.startsWith('data: ')) data = line.slice(6) } const payload = JSON.parse(data) if (event === 'answer.delta') process.stdout.write(payload.text) else if (event === 'answer.replaced') process.stdout.write(`\n[replaced]\n${payload.text}`) else if (event === 'answer.completed') console.log(`\n[${payload.status}]`) else if (event === 'answer.interrupted' || event === 'answer.error') console.log(`\n[${event}]`, payload) }}
id: 1event: message.createddata: {"answer_message_id":"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36","conversation_id":"c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60","user_message_id":"0e6b1d4f-8a27-4c93-b5d0-7f2e9a3c6b18"}id: 2event: answer.starteddata: {"answer_message_id":"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36"}id: 3event: answer.deltadata: {"text":"Mint a new key, move your integration to it, "}id: 4event: answer.sourcesdata: {"citations":[{"anchor":"rotation","ordinal":1,"score":0.82,"snippet":"Rotation is mint-then-revoke: create the replacement first, then revoke the old key.","source_id":"3d8f2a61-7e4b-4c19-9a05-b6e1d7c2f480","title":"Managing API keys","url":"https://docs.example.com/admin/api-keys#rotation"}]}id: 5event: answer.deltadata: {"text":"then revoke the old key [1]."}id: 6event: answer.sourcesdata: {"citations":[{"anchor":"rotation","ordinal":1,"score":0.82,"snippet":"Rotation is mint-then-revoke: create the replacement first, then revoke the old key.","source_id":"3d8f2a61-7e4b-4c19-9a05-b6e1d7c2f480","title":"Managing API keys","url":"https://docs.example.com/admin/api-keys#rotation"}]}id: 7event: answer.completeddata: {"abstained":false,"abstention_reason":null,"answer_message_id":"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36","finish_reason":"end_turn","status":"answered"}
id: 1event: message.createddata: {"answer_message_id":"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36","conversation_id":"c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60","user_message_id":"0e6b1d4f-8a27-4c93-b5d0-7f2e9a3c6b18"}id: 2event: answer.starteddata: {"answer_message_id":"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36"}id: 3event: answer.errordata: {"code":"provider_failure","message":"The upstream provider could not complete the request."}
{ "code": "conflict", "message": "This conversation is already waiting for an answer." }
{ "code": "quota_exceeded", "message": "The monthly answer limit for this account has been reached."}
{ "code": "not_found", "message": "The requested resource was not found." }
{"docsConfig":{"theme":"sequoia","$schema":"https://mintlify.com/docs.json","name":"MITHUNAI Docs","description":"Documentation for MITHUNAI: RAG answers questions from your own documentation with citations, through a website widget, an HTTP API and MCP; Chat, the Gateway, Agents and Team share one account and one sign-in.","colors":{"primary":"#B83E0E","light":"#ED733B","dark":"#B83E0E"},"logo":{"light":"https://mintcdn.com/mithunai/bCUwfPGz6sPBjymO/logo/docs-light.svg?fit=max\u0026auto=format\u0026n=bCUwfPGz6sPBjymO\u0026q=85\u0026s=15cb114eaa2525258b9135ffdf2817ee","dark":"https://mintcdn.com/mithunai/bCUwfPGz6sPBjymO/logo/docs-dark.svg?fit=max\u0026auto=format\u0026n=bCUwfPGz6sPBjymO\u0026q=85\u0026s=6a19fe1581aff13f217356cca6bec212","href":"/"},"favicon":{"light":"https://mintcdn.com/mithunai/bCUwfPGz6sPBjymO/logo/favicon-light.png?fit=max\u0026auto=format\u0026n=bCUwfPGz6sPBjymO\u0026q=85\u0026s=51d47c7fa29f5979c6395fc849ada558","dark":"https://mintcdn.com/mithunai/bCUwfPGz6sPBjymO/logo/favicon-dark.png?fit=max\u0026auto=format\u0026n=bCUwfPGz6sPBjymO\u0026q=85\u0026s=5c5141e387c130da7f64e7fc25b591d7"},"api":{"playground":{"display":"interactive","proxy":true},"examples":{"defaults":"required","languages":["bash","python","javascript"]},"mdx":{"auth":{"method":"bearer"},"server":"https://app.mithunai.com/mithunai/api/v1"}},"appearance":{"default":"light"},"background":{"color":{"light":"#FFFFFF","dark":"#000000"}},"navbar":{"links":[{"href":"https://www.mithunai.com/product","label":"Product"},{"href":"https://www.mithunai.com/pricing","label":"Pricing"},{"href":"https://www.mithunai.com/demo","label":"Book a demo"}],"primary":{"type":"button","label":"Sign in","href":"https://app.mithunai.com/"}},"footer":{"socials":{"website":"https://www.mithunai.com"},"links":[{"header":"Get started","items":[{"label":"Quickstart","href":"/quickstart"},{"label":"Add Ask AI to your website","href":"/channels/widget"},{"label":"Connect sources","href":"/knowledge/sources"},{"label":"Open the console","href":"https://app.mithunai.com/"}]},{"header":"Developers","items":[{"label":"API reference","href":"/api-reference/introduction"},{"label":"HTTP API","href":"/channels/api"},{"label":"MCP server","href":"/channels/mcp"},{"label":"Changelog","href":"/resources/changelog"}]},{"header":"Trust and support","items":[{"label":"Security","href":"/security"},{"label":"Product status","href":"/resources/product-status"},{"label":"Troubleshooting","href":"/resources/troubleshooting"},{"label":"Book a demo","href":"https://www.mithunai.com/demo"}]}]},"search":{"prompt":"Search the docs"},"seo":{"metatags":{"canonical":"https://docs.mithunai.com","og:site_name":"MITHUNAI Docs","og:locale":"en_GB"},"organization":{"id":"https://www.mithunai.com/#organization","name":"MITHUNAI","url":"https://www.mithunai.com","logo":"https://docs.mithunai.com/logo/light.svg"},"indexing":"navigable"},"fonts":{"heading":{"family":"Newsreader","weight":400},"body":{"family":"Inter","weight":400}},"icons":{"library":"lucide"},"styling":{"eyebrows":"breadcrumbs","codeblocks":{"theme":{"light":"github-light","dark":"github-dark"}},"latex":false},"errors":{"404":{"redirect":false,"title":"Page not found","description":"That page does not exist, or has moved. Search the docs, or start from the [introduction](/) or the [quickstart](/quickstart)."}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","cursor","vscode"],"display":"header"},"metadata":{"timestamp":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"mithunai","hasAudioNarration":false,"actualSubdomain":"mithunai","customDomains":["docs.mithunai.com"],"gitSource":{"type":"github","owner":"mithunaihq","repo":"mithunai","deployBranch":"main","contentDirectory":"docs-portal","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6af63d45ddc63e6e75817332","clientVersion":"0.0.4124","searchFilterCounts":[{"language":"default","tag":"API reference","count":193},{"language":"default","tag":"RAG","count":42},{"language":"default","tag":"AI employees","count":41},{"language":"default","tag":"Platform","count":24},{"language":"default","tag":"Knowledge","count":21},{"language":"default","tag":"Team","count":15},{"language":"default","tag":"MITHUNAI Team","count":15},{"language":"default","tag":"Knowledge sources","count":14},{"language":"default","tag":"Get started","count":13},{"language":"default","tag":"AI search visibility","count":13}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":".mdx-content :is(h1,h2,h3){font-weight:400;font-synthesis:none}.mdx-content :is(h4,h5,h6),.card h2{font-family:inherit;font-weight:600;letter-spacing:-0.01em}:where(a,button,input,summary,[tabindex]):focus-visible{outline:2px solid rgb(var(--primary));outline-offset:2px}.dark :where(a,button,input,summary,[tabindex]):focus-visible{outline-color:rgb(var(--primary-light))}.dark .beta-badge{color:#bfbbb4}kbd{font-size:0.8125em}@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:0.01ms!important;animation-iteration-count:1!important;transition-duration:0.01ms!important;scroll-behavior:auto!important}}"}],"page":{"pagePath":"api-reference/conversations/stream-message","slug":"/api-reference/conversations/stream-message","pageMetadata":{"title":"Stream an answer as it is being written","sidebarTitle":"Stream a message","api":"POST /conversations/{conversation_id}/messages:stream","description":"Ask a question and receive the answer as Server-Sent Events while it is generated. Same body and rules as Send a message; only delivery differs.","href":"/api-reference/conversations/stream-message"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Ask a question and receive the answer as Server-Sent Events while it is generated. Same body and rules as Send a message; only delivery differs.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,ParamField,ResponseField,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`This runs the same turn as `,_jsx(_components.a,{href:`/api-reference/conversations/send-message`,children:`Send a message`}),`, with the same request body and the same rules: one question at a time, only the owner can ask, archived conversations refuse questions, and `,_jsx(_components.code,{children:`idempotency_key`}),` makes retries safe. The difference is delivery. The answer arrives as a `,_jsx(_components.code,{children:`text/event-stream`}),` response. See `,_jsx(_components.a,{href:`/api-reference/streaming`,children:`Streaming`}),` for a walkthrough.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Refusals arrive before the stream opens.`}),` Authentication, validation, permission checks and the one-turn-at-a-time claim all run first. If any of them fails, you get an ordinary HTTP error with a JSON body (`,_jsx(_components.code,{children:`400`}),`, `,_jsx(_components.code,{children:`401`}),`, `,_jsx(_components.code,{children:`403`}),`, `,_jsx(_components.code,{children:`404`}),`, `,_jsx(_components.code,{children:`409`}),` or `,_jsx(_components.code,{children:`429`}),`) and no stream. That includes `,_jsx(_components.code,{children:`429`}),` with the code `,_jsx(_components.code,{children:`quota_exceeded`}),` when your organisation has used its `,_jsx(_components.a,{href:`/analyze/usage-and-limits`,children:`monthly answer allowance`}),`; it is never an event on an open stream.`]}),`\n`,_jsxs(_components.p,{children:[`While a question is in progress, another one returns `,_jsx(_components.code,{children:`409`}),`. A question left unanswered for more than 15 minutes, because the server handling it stopped, no longer blocks the conversation: the next question takes over and the lost answer is marked `,_jsx(_components.code,{children:`interrupted`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`This request also resolves the conversation’s assistant. If that assistant can no longer answer (it is `,_jsx(_components.code,{children:`disabled`}),` or `,_jsx(_components.code,{children:`archived`}),`, or has no knowledge attached), this request returns `,_jsx(_components.code,{children:`400`}),` `,_jsx(_components.code,{children:`validation_error`}),`.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`A `,_jsx(_components.code,{children:`200`}),` does not mean the answer succeeded. Once the stream opens, a failure is reported as a\nterminal `,_jsx(_components.code,{children:`answer.error`}),` event on the `,_jsx(_components.code,{children:`200`}),` response. Always read the terminal event.`]})}),`\n`,_jsxs(_components.p,{children:[`If you retry with an `,_jsx(_components.code,{children:`idempotency_key`}),` whose turn has already finished, the stored turn is replayed as a stream: `,_jsx(_components.code,{children:`message.created`}),`, `,_jsx(_components.code,{children:`answer.started`}),`, the full answer text in one `,_jsx(_components.code,{children:`answer.delta`}),`, its `,_jsx(_components.code,{children:`answer.sources`}),` if it has citations, and a terminal event matching how the turn ended. The model is not asked again. A replayed turn that had failed ends with `,_jsx(_components.code,{children:`answer.error`}),`: send a new key to ask again.`]}),`\n`,_jsxs(_components.p,{children:[`If you disconnect, the answer is saved with whatever text was produced and marked `,_jsx(_components.code,{children:`interrupted`}),`, and the conversation is freed for the next question. Streams cannot be resumed and `,_jsx(_components.code,{children:`Last-Event-ID`}),` is not supported; read the answer back with `,_jsx(_components.a,{href:`/api-reference/conversations/list-messages`,children:`List messages`}),`.`]}),`\n`,_jsx(ParamField,{path:`conversation_id`,type:`string`,required:true,id:`param-conversation-id`,children:_jsx(_components.p,{children:`The conversation ID.`})}),`\n`,_jsx(ParamField,{body:`text`,type:`string`,required:true,id:`param-text`,children:_jsx(_components.p,{children:`The question. 1 to 16,000 characters after trimming. Newlines and tabs are allowed; other control\ncharacters and invisible formatting characters are rejected.`})}),`\n`,_jsx(ParamField,{body:`idempotency_key`,type:`string`,id:`param-idempotency-key`,children:_jsxs(_components.p,{children:[`Your own key for this question, unique within the conversation. Up to 128 characters from `,_jsx(_components.code,{children:`A-Z`}),`,\n`,_jsx(_components.code,{children:`a-z`}),`, `,_jsx(_components.code,{children:`0-9`}),`, `,_jsx(_components.code,{children:`_`}),`, `,_jsx(_components.code,{children:`.`}),`, `,_jsx(_components.code,{children:`:`}),` and `,_jsx(_components.code,{children:`-`}),`.`]})}),`\n`,_jsx(ParamField,{body:`metadata`,type:`object`,id:`param-metadata`,children:_jsxs(_components.p,{children:[`Your own labels for the question. At most 20 entries; keys up to 64 characters matching\n`,_jsx(_components.code,{children:`^[a-z][a-z0-9_.-]*$`}),`; values up to 512 characters on a single line.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`Returns `,_jsx(_components.code,{children:`200 OK`}),` with `,_jsx(_components.code,{children:`Content-Type: text/event-stream; charset=utf-8`}),`. Each event is framed as:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`id: 3`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`event: answer.delta`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"text\":\"Mint a new key, \"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`id`}),` is the event’s sequence number. It starts at 1 and increases by exactly 1, so a gap means you lost an event.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`event`}),` is the event type. It is the only place the type appears: `,_jsx(_components.code,{children:`data`}),` does not repeat it.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`data`}),` is a single-line JSON object. Non-ASCII characters are escaped as `,_jsx(_components.code,{children:`\\\\uXXXX`}),`.`]}),`\n`,_jsx(_components.li,{children:`Ignore event types you do not recognize. New ones may be added.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The first event is always `,_jsx(_components.code,{children:`message.created`}),`. Exactly one terminal event ends the stream: `,_jsx(_components.code,{children:`answer.completed`}),`, `,_jsx(_components.code,{children:`answer.interrupted`}),` or `,_jsx(_components.code,{children:`answer.error`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`message-created`,children:_jsx(_components.code,{children:`message.created`})}),`\n`,_jsxs(_components.p,{children:[`The question is saved and an answer message exists with `,_jsx(_components.code,{children:`status`}),` `,_jsx(_components.code,{children:`pending`}),`.`]}),`\n`,_jsx(ResponseField,{name:`conversation_id`,type:`string`,required:true,id:`param-conversation-id-1`,children:_jsx(_components.p,{children:`The conversation ID.`})}),`\n`,_jsx(ResponseField,{name:`user_message_id`,type:`string`,required:true,id:`param-user-message-id`,children:_jsx(_components.p,{children:`The ID of your question message.`})}),`\n`,_jsx(ResponseField,{name:`answer_message_id`,type:`string`,required:true,id:`param-answer-message-id`,children:_jsx(_components.p,{children:`The ID of the answer message being generated.`})}),`\n`,_jsx(Heading,{level:`3`,id:`answer-started`,children:_jsx(_components.code,{children:`answer.started`})}),`\n`,_jsxs(_components.p,{children:[`Generation has begun. The gap between `,_jsx(_components.code,{children:`message.created`}),` and this event is retrieval.`]}),`\n`,_jsx(ResponseField,{name:`answer_message_id`,type:`string`,required:true,id:`param-answer-message-id-1`,children:_jsx(_components.p,{children:`The ID of the answer message.`})}),`\n`,_jsx(Heading,{level:`3`,id:`answer-delta`,children:_jsx(_components.code,{children:`answer.delta`})}),`\n`,_jsx(_components.p,{children:`A piece of answer text. Each delta is an increment, not the text so far: append deltas in order to build the answer.`}),`\n`,_jsx(ResponseField,{name:`text`,type:`string`,required:true,id:`param-text-1`,children:_jsx(_components.p,{children:`The next piece of answer text.`})}),`\n`,_jsx(Heading,{level:`3`,id:`answer-sources`,children:_jsx(_components.code,{children:`answer.sources`})}),`\n`,_jsxs(_components.p,{children:[`The citations the answer uses so far. A new `,_jsx(_components.code,{children:`answer.sources`}),` is sent whenever the answer first cites another source, and it always arrives `,_jsx(_components.strong,{children:`before`}),` the `,_jsx(_components.code,{children:`answer.delta`}),` containing that source’s `,_jsx(_components.code,{children:`[n]`}),` marker, so every marker you render can be linked immediately. Each event carries the full list, so replace your citation list rather than appending to it.`]}),`\n`,_jsxs(_components.p,{children:[`When the answer has citations, a final `,_jsx(_components.code,{children:`answer.sources`}),` with the complete list is sent just before `,_jsx(_components.code,{children:`answer.completed`}),`. If the assistant abstains after sources were sent, a final `,_jsx(_components.code,{children:`answer.sources`}),` with an empty `,_jsx(_components.code,{children:`citations`}),` list clears them.`]}),`\n`,_jsx(ResponseField,{name:`citations`,type:`object[]`,required:true,id:`param-citations`,children:_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`source_id`,type:`string`,id:`param-source-id`,children:_jsx(_components.p,{children:`Identifier of the cited passage. It stays the same while the document’s content is unchanged\nand changes when changed content is re-ingested. It is not a knowledge source ID or a document\nID.`})}),_jsx(ResponseField,{name:`ordinal`,type:`integer`,id:`param-ordinal`,children:_jsxs(_components.p,{children:[`The citation’s number, from 1, matching the `,_jsx(_components.code,{children:`[1]`}),`-style marker in the answer text.`]})}),_jsx(ResponseField,{name:`title`,type:`string`,id:`param-title`,children:_jsx(_components.p,{children:`Title of the cited document. May be an empty string.`})}),_jsx(ResponseField,{name:`url`,type:`string | null`,id:`param-url`,children:_jsx(_components.p,{children:`The source URL, when the document has one.`})}),_jsx(ResponseField,{name:`snippet`,type:`string | null`,id:`param-snippet`,children:_jsx(_components.p,{children:`An excerpt supporting the answer.`})}),_jsx(ResponseField,{name:`anchor`,type:`string | null`,id:`param-anchor`,children:_jsx(_components.p,{children:`A location within the source, such as a heading or page.`})}),_jsx(ResponseField,{name:`score`,type:`number | null`,id:`param-score`,children:_jsx(_components.p,{children:`The retrieval relevance score of the cited passage. Higher is more relevant. Use it for\ndiagnostics and ranking, not as a probability.`})})]})}),`\n`,_jsx(Heading,{level:`3`,id:`answer-replaced`,children:_jsx(_components.code,{children:`answer.replaced`})}),`\n`,_jsxs(_components.p,{children:[`The answer’s final checks withdrew or rewrote the text already streamed, for example turning an answer that did not cite its sources into an abstention, or removing a link that could not be verified. Discard every `,_jsx(_components.code,{children:`answer.delta`}),` you have received and show this text instead. Later deltas, if any, append to it. The stored message holds only the final text.`]}),`\n`,_jsx(ResponseField,{name:`text`,type:`string`,required:true,id:`param-text-2`,children:_jsx(_components.p,{children:`The whole answer so far, replacing everything streamed before it.`})}),`\n`,_jsxs(Heading,{level:`3`,id:`answer-completed-terminal`,children:[_jsx(_components.code,{children:`answer.completed`}),` (terminal)`]}),`\n`,_jsxs(_components.p,{children:[`The answer finished and is saved with `,_jsx(_components.code,{children:`status`}),` `,_jsx(_components.code,{children:`complete`}),`.`]}),`\n`,_jsx(ResponseField,{name:`answer_message_id`,type:`string`,required:true,id:`param-answer-message-id-2`,children:_jsx(_components.p,{children:`The ID of the answer message.`})}),`\n`,_jsx(ResponseField,{name:`status`,type:`string`,required:true,id:`param-status`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`answered`}),`, or `,_jsx(_components.code,{children:`abstained`}),` when the assistant declined because your knowledge did not support an\nanswer.`]})}),`\n`,_jsx(ResponseField,{name:`abstained`,type:`boolean`,required:true,id:`param-abstained`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` for an abstention. An abstention is a successful outcome, not an error; do not present its\nsources as supporting an answer. See `,_jsx(_components.a,{href:`/concepts/how-answers-work`,children:`How answers work`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`finish_reason`,type:`string | null`,required:true,id:`param-finish-reason`,children:_jsxs(_components.p,{children:[`Why generation stopped, as reported. `,_jsx(_components.code,{children:`length`}),` means the answer was cut off at the output limit and\nis incomplete.`]})}),`\n`,_jsxs(ResponseField,{name:`abstention_reason`,type:`string | null`,required:true,id:`param-abstention-reason`,children:[_jsxs(_components.p,{children:[`Why the assistant declined, or `,_jsx(_components.code,{children:`null`}),` when it declined without naming a reason. Always `,_jsx(_components.code,{children:`null`}),` when\n`,_jsx(_components.code,{children:`abstained`}),` is `,_jsx(_components.code,{children:`false`}),`.`]}),_jsxs(_components.p,{children:[`An `,_jsx(_components.strong,{children:`open string`}),`: match the values you know and fall back to a generic notice for one you do not.\nNew values are not a breaking change.`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Value`}),_jsx(_components.th,{children:`What it means`}),_jsx(_components.th,{children:`What changes it`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`no_evidence`})}),_jsx(_components.td,{children:`Nothing came back from your sources at all.`}),_jsx(_components.td,{children:`Connect a source that covers the subject.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`below_score_threshold`})}),_jsx(_components.td,{children:`Passages came back; none was a close enough match.`}),_jsx(_components.td,{children:`A source that covers it directly, or a lower grounding threshold.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`weak_best_match`})}),_jsx(_components.td,{children:`Passages cleared the floor, but the closest was still only loosely related.`}),_jsx(_components.td,{children:`A more specific question, or better coverage.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`too_few_passages`})}),_jsx(_components.td,{children:`Fewer passages cleared the bar than the assistant answers from.`}),_jsx(_components.td,{children:`Coverage in more than one place, or a lower minimum.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`model_declined`})}),_jsx(_components.td,{children:`The passages passed the gate and the model still judged them insufficient.`}),_jsx(_components.td,{children:`Reword, or improve the source. A retrieval-quality signal, not a coverage gap.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`no_supporting_citation`})}),_jsx(_components.td,{children:`A draft answer cited no real passage, so it was withheld.`}),_jsx(_components.td,{children:`Nothing on your side — the grounding check working.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`unverified_link`})}),_jsx(_components.td,{children:`The draft contained a link that appears in none of the cited passages.`}),_jsx(_components.td,{children:`Same.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`provider_filtered`})}),_jsx(_components.td,{children:`The model provider declined to produce output.`}),_jsx(_components.td,{children:`Reword, or retry.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`empty_generation`})}),_jsx(_components.td,{children:`The provider returned nothing.`}),_jsx(_components.td,{children:`Retry.`})]})]})]}),_jsxs(_components.p,{children:[`The widget surface receives a deliberately coarser set — see\n`,_jsx(_components.a,{href:`/api-reference/widget/stream-thread-message`,children:`Stream a thread message`}),`.`]}),_jsxs(_components.p,{children:[`This is a streaming field only: a message read back from\n`,_jsx(_components.a,{href:`/api-reference/conversations/list-messages`,children:`List messages`}),` carries `,_jsx(_components.code,{children:`abstained`}),` but no reason, and a\nreplayed idempotent turn sends `,_jsx(_components.code,{children:`null`}),`.`]})]}),`\n`,_jsxs(Heading,{level:`3`,id:`answer-interrupted-terminal`,children:[_jsx(_components.code,{children:`answer.interrupted`}),` (terminal)`]}),`\n`,_jsxs(_components.p,{children:[`Generation produced some text and then stopped early. The partial answer is saved with `,_jsx(_components.code,{children:`status`}),` `,_jsx(_components.code,{children:`interrupted`}),`. You have text to show, but it is not a complete answer.`]}),`\n`,_jsx(ResponseField,{name:`answer_message_id`,type:`string`,required:true,id:`param-answer-message-id-3`,children:_jsx(_components.p,{children:`The ID of the answer message.`})}),`\n`,_jsx(ResponseField,{name:`reason`,type:`string`,required:true,id:`param-reason`,children:_jsxs(_components.p,{children:[`Why it stopped: an error code such as `,_jsx(_components.code,{children:`provider_failure`}),` when generation failed part-way,\n`,_jsx(_components.code,{children:`incomplete_stream`}),` when generation ended without finishing, or `,_jsx(_components.code,{children:`interrupted`}),` on a replayed turn.`]})}),`\n`,_jsxs(Heading,{level:`3`,id:`answer-error-terminal`,children:[_jsx(_components.code,{children:`answer.error`}),` (terminal)`]}),`\n`,_jsxs(_components.p,{children:[`Generation failed before producing any text. The answer is saved with `,_jsx(_components.code,{children:`status`}),` `,_jsx(_components.code,{children:`failed`}),`, and the conversation is free for the next question.`]}),`\n`,_jsx(ResponseField,{name:`code`,type:`string`,required:true,id:`param-code`,children:_jsxs(_components.p,{children:[`A stable error code, such as `,_jsx(_components.code,{children:`provider_failure`}),`, `,_jsx(_components.code,{children:`retrieval_failure`}),`, `,_jsx(_components.code,{children:`dependency_failure`}),` or\n`,_jsx(_components.code,{children:`internal_error`}),`. See `,_jsx(_components.a,{href:`/api-reference/errors`,children:`Errors`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`message`,type:`string`,required:true,id:`param-message`,children:_jsx(_components.p,{children:`A client-safe message. It never contains internal detail.`})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"github-light","dark":"github-dark"}},"config":{},"pageMetadata":{"title":"Stream an answer as it is being written","sidebarTitle":"Stream a message","api":"POST /conversations/{conversation_id}/messages:stream","description":"Ask a question and receive the answer as Server-Sent Events while it is generated. Same body and rules as Send a message; only delivery differs.","href":"/api-reference/conversations/stream-message"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,ParamField,RequestExample,ResponseExample,ResponseField,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`This runs the same turn as `,_jsx(_components.a,{href:`/api-reference/conversations/send-message`,children:`Send a message`}),`, with the same request body and the same rules: one question at a time, only the owner can ask, archived conversations refuse questions, and `,_jsx(_components.code,{children:`idempotency_key`}),` makes retries safe. The difference is delivery. The answer arrives as a `,_jsx(_components.code,{children:`text/event-stream`}),` response. See `,_jsx(_components.a,{href:`/api-reference/streaming`,children:`Streaming`}),` for a walkthrough.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Refusals arrive before the stream opens.`}),` Authentication, validation, permission checks and the one-turn-at-a-time claim all run first. If any of them fails, you get an ordinary HTTP error with a JSON body (`,_jsx(_components.code,{children:`400`}),`, `,_jsx(_components.code,{children:`401`}),`, `,_jsx(_components.code,{children:`403`}),`, `,_jsx(_components.code,{children:`404`}),`, `,_jsx(_components.code,{children:`409`}),` or `,_jsx(_components.code,{children:`429`}),`) and no stream. That includes `,_jsx(_components.code,{children:`429`}),` with the code `,_jsx(_components.code,{children:`quota_exceeded`}),` when your organisation has used its `,_jsx(_components.a,{href:`/analyze/usage-and-limits`,children:`monthly answer allowance`}),`; it is never an event on an open stream.`]}),`\n`,_jsxs(_components.p,{children:[`While a question is in progress, another one returns `,_jsx(_components.code,{children:`409`}),`. A question left unanswered for more than 15 minutes, because the server handling it stopped, no longer blocks the conversation: the next question takes over and the lost answer is marked `,_jsx(_components.code,{children:`interrupted`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`This request also resolves the conversation’s assistant. If that assistant can no longer answer (it is `,_jsx(_components.code,{children:`disabled`}),` or `,_jsx(_components.code,{children:`archived`}),`, or has no knowledge attached), this request returns `,_jsx(_components.code,{children:`400`}),` `,_jsx(_components.code,{children:`validation_error`}),`.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`A `,_jsx(_components.code,{children:`200`}),` does not mean the answer succeeded. Once the stream opens, a failure is reported as a\nterminal `,_jsx(_components.code,{children:`answer.error`}),` event on the `,_jsx(_components.code,{children:`200`}),` response. Always read the terminal event.`]})}),`\n`,_jsxs(_components.p,{children:[`If you retry with an `,_jsx(_components.code,{children:`idempotency_key`}),` whose turn has already finished, the stored turn is replayed as a stream: `,_jsx(_components.code,{children:`message.created`}),`, `,_jsx(_components.code,{children:`answer.started`}),`, the full answer text in one `,_jsx(_components.code,{children:`answer.delta`}),`, its `,_jsx(_components.code,{children:`answer.sources`}),` if it has citations, and a terminal event matching how the turn ended. The model is not asked again. A replayed turn that had failed ends with `,_jsx(_components.code,{children:`answer.error`}),`: send a new key to ask again.`]}),`\n`,_jsxs(_components.p,{children:[`If you disconnect, the answer is saved with whatever text was produced and marked `,_jsx(_components.code,{children:`interrupted`}),`, and the conversation is freed for the next question. Streams cannot be resumed and `,_jsx(_components.code,{children:`Last-Event-ID`}),` is not supported; read the answer back with `,_jsx(_components.a,{href:`/api-reference/conversations/list-messages`,children:`List messages`}),`.`]}),`\n`,_jsx(ParamField,{path:`conversation_id`,type:`string`,required:true,id:`param-conversation-id`,children:_jsx(_components.p,{children:`The conversation ID.`})}),`\n`,_jsx(ParamField,{body:`text`,type:`string`,required:true,id:`param-text`,children:_jsx(_components.p,{children:`The question. 1 to 16,000 characters after trimming. Newlines and tabs are allowed; other control\ncharacters and invisible formatting characters are rejected.`})}),`\n`,_jsx(ParamField,{body:`idempotency_key`,type:`string`,id:`param-idempotency-key`,children:_jsxs(_components.p,{children:[`Your own key for this question, unique within the conversation. Up to 128 characters from `,_jsx(_components.code,{children:`A-Z`}),`,\n`,_jsx(_components.code,{children:`a-z`}),`, `,_jsx(_components.code,{children:`0-9`}),`, `,_jsx(_components.code,{children:`_`}),`, `,_jsx(_components.code,{children:`.`}),`, `,_jsx(_components.code,{children:`:`}),` and `,_jsx(_components.code,{children:`-`}),`.`]})}),`\n`,_jsx(ParamField,{body:`metadata`,type:`object`,id:`param-metadata`,children:_jsxs(_components.p,{children:[`Your own labels for the question. At most 20 entries; keys up to 64 characters matching\n`,_jsx(_components.code,{children:`^[a-z][a-z0-9_.-]*$`}),`; values up to 512 characters on a single line.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`Returns `,_jsx(_components.code,{children:`200 OK`}),` with `,_jsx(_components.code,{children:`Content-Type: text/event-stream; charset=utf-8`}),`. Each event is framed as:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`id: 3`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`event: answer.delta`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"text\":\"Mint a new key, \"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`id`}),` is the event’s sequence number. It starts at 1 and increases by exactly 1, so a gap means you lost an event.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`event`}),` is the event type. It is the only place the type appears: `,_jsx(_components.code,{children:`data`}),` does not repeat it.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`data`}),` is a single-line JSON object. Non-ASCII characters are escaped as `,_jsx(_components.code,{children:`\\\\uXXXX`}),`.`]}),`\n`,_jsx(_components.li,{children:`Ignore event types you do not recognize. New ones may be added.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The first event is always `,_jsx(_components.code,{children:`message.created`}),`. Exactly one terminal event ends the stream: `,_jsx(_components.code,{children:`answer.completed`}),`, `,_jsx(_components.code,{children:`answer.interrupted`}),` or `,_jsx(_components.code,{children:`answer.error`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`message-created`,children:_jsx(_components.code,{children:`message.created`})}),`\n`,_jsxs(_components.p,{children:[`The question is saved and an answer message exists with `,_jsx(_components.code,{children:`status`}),` `,_jsx(_components.code,{children:`pending`}),`.`]}),`\n`,_jsx(ResponseField,{name:`conversation_id`,type:`string`,required:true,id:`param-conversation-id-1`,children:_jsx(_components.p,{children:`The conversation ID.`})}),`\n`,_jsx(ResponseField,{name:`user_message_id`,type:`string`,required:true,id:`param-user-message-id`,children:_jsx(_components.p,{children:`The ID of your question message.`})}),`\n`,_jsx(ResponseField,{name:`answer_message_id`,type:`string`,required:true,id:`param-answer-message-id`,children:_jsx(_components.p,{children:`The ID of the answer message being generated.`})}),`\n`,_jsx(Heading,{level:`3`,id:`answer-started`,children:_jsx(_components.code,{children:`answer.started`})}),`\n`,_jsxs(_components.p,{children:[`Generation has begun. The gap between `,_jsx(_components.code,{children:`message.created`}),` and this event is retrieval.`]}),`\n`,_jsx(ResponseField,{name:`answer_message_id`,type:`string`,required:true,id:`param-answer-message-id-1`,children:_jsx(_components.p,{children:`The ID of the answer message.`})}),`\n`,_jsx(Heading,{level:`3`,id:`answer-delta`,children:_jsx(_components.code,{children:`answer.delta`})}),`\n`,_jsx(_components.p,{children:`A piece of answer text. Each delta is an increment, not the text so far: append deltas in order to build the answer.`}),`\n`,_jsx(ResponseField,{name:`text`,type:`string`,required:true,id:`param-text-1`,children:_jsx(_components.p,{children:`The next piece of answer text.`})}),`\n`,_jsx(Heading,{level:`3`,id:`answer-sources`,children:_jsx(_components.code,{children:`answer.sources`})}),`\n`,_jsxs(_components.p,{children:[`The citations the answer uses so far. A new `,_jsx(_components.code,{children:`answer.sources`}),` is sent whenever the answer first cites another source, and it always arrives `,_jsx(_components.strong,{children:`before`}),` the `,_jsx(_components.code,{children:`answer.delta`}),` containing that source’s `,_jsx(_components.code,{children:`[n]`}),` marker, so every marker you render can be linked immediately. Each event carries the full list, so replace your citation list rather than appending to it.`]}),`\n`,_jsxs(_components.p,{children:[`When the answer has citations, a final `,_jsx(_components.code,{children:`answer.sources`}),` with the complete list is sent just before `,_jsx(_components.code,{children:`answer.completed`}),`. If the assistant abstains after sources were sent, a final `,_jsx(_components.code,{children:`answer.sources`}),` with an empty `,_jsx(_components.code,{children:`citations`}),` list clears them.`]}),`\n`,_jsx(ResponseField,{name:`citations`,type:`object[]`,required:true,id:`param-citations`,children:_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`source_id`,type:`string`,id:`param-source-id`,children:_jsx(_components.p,{children:`Identifier of the cited passage. It stays the same while the document’s content is unchanged\nand changes when changed content is re-ingested. It is not a knowledge source ID or a document\nID.`})}),_jsx(ResponseField,{name:`ordinal`,type:`integer`,id:`param-ordinal`,children:_jsxs(_components.p,{children:[`The citation’s number, from 1, matching the `,_jsx(_components.code,{children:`[1]`}),`-style marker in the answer text.`]})}),_jsx(ResponseField,{name:`title`,type:`string`,id:`param-title`,children:_jsx(_components.p,{children:`Title of the cited document. May be an empty string.`})}),_jsx(ResponseField,{name:`url`,type:`string | null`,id:`param-url`,children:_jsx(_components.p,{children:`The source URL, when the document has one.`})}),_jsx(ResponseField,{name:`snippet`,type:`string | null`,id:`param-snippet`,children:_jsx(_components.p,{children:`An excerpt supporting the answer.`})}),_jsx(ResponseField,{name:`anchor`,type:`string | null`,id:`param-anchor`,children:_jsx(_components.p,{children:`A location within the source, such as a heading or page.`})}),_jsx(ResponseField,{name:`score`,type:`number | null`,id:`param-score`,children:_jsx(_components.p,{children:`The retrieval relevance score of the cited passage. Higher is more relevant. Use it for\ndiagnostics and ranking, not as a probability.`})})]})}),`\n`,_jsx(Heading,{level:`3`,id:`answer-replaced`,children:_jsx(_components.code,{children:`answer.replaced`})}),`\n`,_jsxs(_components.p,{children:[`The answer’s final checks withdrew or rewrote the text already streamed, for example turning an answer that did not cite its sources into an abstention, or removing a link that could not be verified. Discard every `,_jsx(_components.code,{children:`answer.delta`}),` you have received and show this text instead. Later deltas, if any, append to it. The stored message holds only the final text.`]}),`\n`,_jsx(ResponseField,{name:`text`,type:`string`,required:true,id:`param-text-2`,children:_jsx(_components.p,{children:`The whole answer so far, replacing everything streamed before it.`})}),`\n`,_jsxs(Heading,{level:`3`,id:`answer-completed-terminal`,children:[_jsx(_components.code,{children:`answer.completed`}),` (terminal)`]}),`\n`,_jsxs(_components.p,{children:[`The answer finished and is saved with `,_jsx(_components.code,{children:`status`}),` `,_jsx(_components.code,{children:`complete`}),`.`]}),`\n`,_jsx(ResponseField,{name:`answer_message_id`,type:`string`,required:true,id:`param-answer-message-id-2`,children:_jsx(_components.p,{children:`The ID of the answer message.`})}),`\n`,_jsx(ResponseField,{name:`status`,type:`string`,required:true,id:`param-status`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`answered`}),`, or `,_jsx(_components.code,{children:`abstained`}),` when the assistant declined because your knowledge did not support an\nanswer.`]})}),`\n`,_jsx(ResponseField,{name:`abstained`,type:`boolean`,required:true,id:`param-abstained`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` for an abstention. An abstention is a successful outcome, not an error; do not present its\nsources as supporting an answer. See `,_jsx(_components.a,{href:`/concepts/how-answers-work`,children:`How answers work`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`finish_reason`,type:`string | null`,required:true,id:`param-finish-reason`,children:_jsxs(_components.p,{children:[`Why generation stopped, as reported. `,_jsx(_components.code,{children:`length`}),` means the answer was cut off at the output limit and\nis incomplete.`]})}),`\n`,_jsxs(ResponseField,{name:`abstention_reason`,type:`string | null`,required:true,id:`param-abstention-reason`,children:[_jsxs(_components.p,{children:[`Why the assistant declined, or `,_jsx(_components.code,{children:`null`}),` when it declined without naming a reason. Always `,_jsx(_components.code,{children:`null`}),` when\n`,_jsx(_components.code,{children:`abstained`}),` is `,_jsx(_components.code,{children:`false`}),`.`]}),_jsxs(_components.p,{children:[`An `,_jsx(_components.strong,{children:`open string`}),`: match the values you know and fall back to a generic notice for one you do not.\nNew values are not a breaking change.`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Value`}),_jsx(_components.th,{children:`What it means`}),_jsx(_components.th,{children:`What changes it`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`no_evidence`})}),_jsx(_components.td,{children:`Nothing came back from your sources at all.`}),_jsx(_components.td,{children:`Connect a source that covers the subject.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`below_score_threshold`})}),_jsx(_components.td,{children:`Passages came back; none was a close enough match.`}),_jsx(_components.td,{children:`A source that covers it directly, or a lower grounding threshold.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`weak_best_match`})}),_jsx(_components.td,{children:`Passages cleared the floor, but the closest was still only loosely related.`}),_jsx(_components.td,{children:`A more specific question, or better coverage.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`too_few_passages`})}),_jsx(_components.td,{children:`Fewer passages cleared the bar than the assistant answers from.`}),_jsx(_components.td,{children:`Coverage in more than one place, or a lower minimum.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`model_declined`})}),_jsx(_components.td,{children:`The passages passed the gate and the model still judged them insufficient.`}),_jsx(_components.td,{children:`Reword, or improve the source. A retrieval-quality signal, not a coverage gap.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`no_supporting_citation`})}),_jsx(_components.td,{children:`A draft answer cited no real passage, so it was withheld.`}),_jsx(_components.td,{children:`Nothing on your side — the grounding check working.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`unverified_link`})}),_jsx(_components.td,{children:`The draft contained a link that appears in none of the cited passages.`}),_jsx(_components.td,{children:`Same.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`provider_filtered`})}),_jsx(_components.td,{children:`The model provider declined to produce output.`}),_jsx(_components.td,{children:`Reword, or retry.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`empty_generation`})}),_jsx(_components.td,{children:`The provider returned nothing.`}),_jsx(_components.td,{children:`Retry.`})]})]})]}),_jsxs(_components.p,{children:[`The widget surface receives a deliberately coarser set — see\n`,_jsx(_components.a,{href:`/api-reference/widget/stream-thread-message`,children:`Stream a thread message`}),`.`]}),_jsxs(_components.p,{children:[`This is a streaming field only: a message read back from\n`,_jsx(_components.a,{href:`/api-reference/conversations/list-messages`,children:`List messages`}),` carries `,_jsx(_components.code,{children:`abstained`}),` but no reason, and a\nreplayed idempotent turn sends `,_jsx(_components.code,{children:`null`}),`.`]})]}),`\n`,_jsxs(Heading,{level:`3`,id:`answer-interrupted-terminal`,children:[_jsx(_components.code,{children:`answer.interrupted`}),` (terminal)`]}),`\n`,_jsxs(_components.p,{children:[`Generation produced some text and then stopped early. The partial answer is saved with `,_jsx(_components.code,{children:`status`}),` `,_jsx(_components.code,{children:`interrupted`}),`. You have text to show, but it is not a complete answer.`]}),`\n`,_jsx(ResponseField,{name:`answer_message_id`,type:`string`,required:true,id:`param-answer-message-id-3`,children:_jsx(_components.p,{children:`The ID of the answer message.`})}),`\n`,_jsx(ResponseField,{name:`reason`,type:`string`,required:true,id:`param-reason`,children:_jsxs(_components.p,{children:[`Why it stopped: an error code such as `,_jsx(_components.code,{children:`provider_failure`}),` when generation failed part-way,\n`,_jsx(_components.code,{children:`incomplete_stream`}),` when generation ended without finishing, or `,_jsx(_components.code,{children:`interrupted`}),` on a replayed turn.`]})}),`\n`,_jsxs(Heading,{level:`3`,id:`answer-error-terminal`,children:[_jsx(_components.code,{children:`answer.error`}),` (terminal)`]}),`\n`,_jsxs(_components.p,{children:[`Generation failed before producing any text. The answer is saved with `,_jsx(_components.code,{children:`status`}),` `,_jsx(_components.code,{children:`failed`}),`, and the conversation is free for the next question.`]}),`\n`,_jsx(ResponseField,{name:`code`,type:`string`,required:true,id:`param-code`,children:_jsxs(_components.p,{children:[`A stable error code, such as `,_jsx(_components.code,{children:`provider_failure`}),`, `,_jsx(_components.code,{children:`retrieval_failure`}),`, `,_jsx(_components.code,{children:`dependency_failure`}),` or\n`,_jsx(_components.code,{children:`internal_error`}),`. See `,_jsx(_components.a,{href:`/api-reference/errors`,children:`Errors`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`message`,type:`string`,required:true,id:`param-message`,children:_jsx(_components.p,{children:`A client-safe message. It never contains internal detail.`})}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`curl`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -N`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` --request`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` POST`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`$MITHUNAI_URL`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`/mithunai/api/v1/conversations/c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60/messages:stream\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` --header`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`$MITHUNAI_API_KEY`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` --header`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` --data`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` '{\"text\": \"How do I rotate an API key?\", \"idempotency_key\": \"ticket-4821-q1\"}'`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`27`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`27`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`import`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` json, os, requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`conversation_id `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`url `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` f`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`{`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`'MITHUNAI_URL'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`]`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`}`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`/mithunai/api/v1/conversations/`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`{`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`conversation_id`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`}`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`/messages:stream\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`with`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` requests.post(`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` url,`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` headers`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Authorization\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`f`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Bearer `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`{`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`'MITHUNAI_API_KEY'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`]`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`}`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` json`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"text\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"How do I rotate an API key?\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"idempotency_key\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"ticket-4821-q1\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` stream`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`True`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` timeout`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`120`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`) `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`as`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` response:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` response.raise_for_status() `}),_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:`# Refusals arrive here, before any event.`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` event `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` None`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` for`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` line `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`in`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` response.iter_lines(`}),_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:`decode_unicode`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`True`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` line.startswith(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"event: \"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` event `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` line[`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`len`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"event: \"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`):]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` elif`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` line.startswith(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"data: \"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` data `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` json.loads(line[`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`len`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"data: \"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`):])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` event `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`==`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"answer.delta\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` print`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(data[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"text\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`], `}),_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:`end`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:`flush`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`True`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` elif`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` event `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`==`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"answer.replaced\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` print`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`f`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`[replaced]`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\\\\n{`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`data[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`'text'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`]`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`}`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:`end`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:`flush`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`True`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` elif`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` event `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`==`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"answer.completed\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` print`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`f`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`[`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`{`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`data[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`'status'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`]`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`}`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`]\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` elif`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` event `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`in`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` (`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"answer.interrupted\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"answer.error\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` print`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`f`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`[`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`{`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`event`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`}`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`] `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`{`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`data`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`}`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`42`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`42`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` conversationId`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` 'c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` response`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` await`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` fetch`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:\" `${\"}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`process`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`env`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`.`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`MITHUNAI_URL`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:\"}/mithunai/api/v1/conversations/${\"}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`conversationId`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:\"}/messages:stream`\"}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` method: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`'POST'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` headers: {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` Authorization: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:\"`Bearer ${\"}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`process`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`env`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`.`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`MITHUNAI_API_KEY`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:\"}`\"}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`'application/json'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` body: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`JSON`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`stringify`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` text: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`'How do I rotate an API key?'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` idempotency_key: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`'ticket-4821-q1'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` (`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`!`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`response.ok) `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`throw`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` new`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` Error`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`JSON`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`stringify`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`await`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` response.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`json`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`()))`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` reader`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` response.body.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`getReader`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` decoder`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` new`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` TextDecoder`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`let`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` buffer `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` ''`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`for`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` (;;) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` const`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` { `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`done`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`value`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` } `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` await`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` reader.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`read`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` (done) `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`break`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` buffer `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`+=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` decoder.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`decode`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(value, { stream: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`true`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` })`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` let`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` boundary`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` while`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` ((boundary `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` buffer.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`indexOf`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`'`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)) `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`!==`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` -`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`1`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` record`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` buffer.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`slice`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`0`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, boundary)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` buffer `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` buffer.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`slice`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(boundary `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`+`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 2`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` let`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` event `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` ''`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` let`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` data `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` ''`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` for`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` (`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` line`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` of`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` record.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`split`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`'`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` (line.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`startsWith`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`'event: '`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)) event `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` line.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`slice`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`7`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` else`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` (line.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`startsWith`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`'data: '`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)) data `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` line.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`slice`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`6`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` payload`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`parse`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(data)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` (event `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`===`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` 'answer.delta'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`) process.stdout.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`write`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(payload.text)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` else`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` (event `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`===`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` 'answer.replaced'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`) process.stdout.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`write`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:\"`\"}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`[replaced]`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:\"${\"}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`payload`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`text`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:\"}`\"}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` else`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` (event `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`===`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` 'answer.completed'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`) console.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`log`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:\"`\"}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:\"[${\"}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`payload`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`status`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:\"}]`\"}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` else`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` (event `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`===`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` 'answer.interrupted'`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` ||`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` event `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`===`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` 'answer.error'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` console.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`log`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:\"`\"}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:\"[${\"}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`event`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:\"}]`\"}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, payload)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`]})})})]}),`\n`,_jsxs(ResponseExample,{children:[_jsx(CodeBlock,{filename:`200`,numberOfLines:`29`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`29`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`id: 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`event: message.created`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"answer_message_id\":\"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36\",\"conversation_id\":\"c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60\",\"user_message_id\":\"0e6b1d4f-8a27-4c93-b5d0-7f2e9a3c6b18\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`id: 2`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`event: answer.started`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"answer_message_id\":\"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`id: 3`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`event: answer.delta`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"text\":\"Mint a new key, move your integration to it, \"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`id: 4`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`event: answer.sources`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"citations\":[{\"anchor\":\"rotation\",\"ordinal\":1,\"score\":0.82,\"snippet\":\"Rotation is mint-then-revoke: create the replacement first, then revoke the old key.\",\"source_id\":\"3d8f2a61-7e4b-4c19-9a05-b6e1d7c2f480\",\"title\":\"Managing API keys\",\"url\":\"https://docs.example.com/admin/api-keys#rotation\"}]}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`id: 5`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`event: answer.delta`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"text\":\"then revoke the old key [1].\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`id: 6`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`event: answer.sources`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"citations\":[{\"anchor\":\"rotation\",\"ordinal\":1,\"score\":0.82,\"snippet\":\"Rotation is mint-then-revoke: create the replacement first, then revoke the old key.\",\"source_id\":\"3d8f2a61-7e4b-4c19-9a05-b6e1d7c2f480\",\"title\":\"Managing API keys\",\"url\":\"https://docs.example.com/admin/api-keys#rotation\"}]}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`id: 7`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`event: answer.completed`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"abstained\":false,\"abstention_reason\":null,\"answer_message_id\":\"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36\",\"finish_reason\":\"end_turn\",\"status\":\"answered\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),_jsx(CodeBlock,{filename:`200 (failure)`,numberOfLines:`13`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`13`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`id: 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`event: message.created`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"answer_message_id\":\"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36\",\"conversation_id\":\"c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60\",\"user_message_id\":\"0e6b1d4f-8a27-4c93-b5d0-7f2e9a3c6b18\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`id: 2`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`event: answer.started`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"answer_message_id\":\"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`id: 3`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`event: answer.error`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"code\":\"provider_failure\",\"message\":\"The upstream provider could not complete the request.\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),_jsx(CodeBlock,{filename:`409`,numberOfLines:`1`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{ `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"conflict\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"This conversation is already waiting for an answer.\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` }`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`429`,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"quota_exceeded\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"The monthly answer limit for this account has been reached.\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`404`,numberOfLines:`1`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{ `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"not_found\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"The requested resource was not found.\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` }`})]}),`\n`]})})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"github-light","dark":"github-dark"}},"config":{},"pageMetadata":{"title":"Stream an answer as it is being written","sidebarTitle":"Stream a message","api":"POST /conversations/{conversation_id}/messages:stream","description":"Ask a question and receive the answer as Server-Sent Events while it is generated. Same body and rules as Send a message; only delivery differs.","href":"/api-reference/conversations/stream-message"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Response","slug":"response","depth":2,"children":[{"title":"message.created","slug":"message-created","depth":3,"children":[]},{"title":"answer.started","slug":"answer-started","depth":3,"children":[]},{"title":"answer.delta","slug":"answer-delta","depth":3,"children":[]},{"title":"answer.sources","slug":"answer-sources","depth":3,"children":[]},{"title":"answer.replaced","slug":"answer-replaced","depth":3,"children":[]},{"title":"answer.completed (terminal)","slug":"answer-completed-terminal","depth":3,"children":[]},{"title":"answer.interrupted (terminal)","slug":"answer-interrupted-terminal","depth":3,"children":[]},{"title":"answer.error (terminal)","slug":"answer-error-terminal","depth":3,"children":[]}]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">curl\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> -N\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> --request\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> POST\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">$MITHUNAI_URL\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">/mithunai/api/v1/conversations/c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60/messages:stream\"\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> --header\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"Authorization: Bearer \u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">$MITHUNAI_API_KEY\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> --header\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"Content-Type: application/json\"\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> --data\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> '{\"text\": \"How do I rotate an API key?\", \"idempotency_key\": \"ticket-4821-q1\"}'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Python","html":"\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" language=\"python\">\u003ccode language=\"python\" numberOfLines=\"27\">\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">import\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> json, os, requests\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">conversation_id \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">url \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> f\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">{\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">os.environ[\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'MITHUNAI_URL'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">]\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">}\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">/mithunai/api/v1/conversations/\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">{\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">conversation_id\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">}\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">/messages:stream\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">with\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> requests.post(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> url,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#E36209;--shiki-dark:#FFAB70\"> headers\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">{\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"Authorization\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">f\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"Bearer \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">{\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">os.environ[\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'MITHUNAI_API_KEY'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">]\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">}\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">},\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#E36209;--shiki-dark:#FFAB70\"> json\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">{\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"text\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"How do I rotate an API key?\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">, \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"idempotency_key\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"ticket-4821-q1\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">},\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#E36209;--shiki-dark:#FFAB70\"> stream\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">True\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#E36209;--shiki-dark:#FFAB70\"> timeout\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">120\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">) \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">as\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> response:\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> response.raise_for_status() \u003c/span>\u003cspan style=\"color:#6A737D;--shiki-dark:#6A737D\"># Refusals arrive here, before any event.\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> event \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> None\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> for\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> line \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">in\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> response.iter_lines(\u003c/span>\u003cspan style=\"color:#E36209;--shiki-dark:#FFAB70\">decode_unicode\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">True\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">):\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> if\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> line.startswith(\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"event: \"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">):\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> event \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> line[\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">len\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"event: \"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">):]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> elif\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> line.startswith(\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"data: \"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">):\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> data \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> json.loads(line[\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">len\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"data: \"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">):])\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> if\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> event \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">==\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"answer.delta\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">:\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> print\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(data[\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"text\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">], \u003c/span>\u003cspan style=\"color:#E36209;--shiki-dark:#FFAB70\">end\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">, \u003c/span>\u003cspan style=\"color:#E36209;--shiki-dark:#FFAB70\">flush\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">True\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> elif\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> event \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">==\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"answer.replaced\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">:\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> print\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">f\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\\n\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">[replaced]\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\\n{\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">data[\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'text'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">]\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">}\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">, \u003c/span>\u003cspan style=\"color:#E36209;--shiki-dark:#FFAB70\">end\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">, \u003c/span>\u003cspan style=\"color:#E36209;--shiki-dark:#FFAB70\">flush\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">True\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> elif\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> event \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">==\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"answer.completed\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">:\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> print\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">f\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\\n\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">[\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">{\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">data[\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'status'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">]\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">}\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">]\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> elif\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> event \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">in\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> (\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"answer.interrupted\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">, \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"answer.error\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">):\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> print\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">f\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\\n\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">[\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">{\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">event\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">}\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">] \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">{\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">data\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">}\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">)\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"JavaScript","html":"\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" language=\"javascript\">\u003ccode language=\"javascript\" numberOfLines=\"42\">\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">const\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> conversationId\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> =\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> 'c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60'\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">const\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> response\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> =\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> await\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\"> fetch\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> `${\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">process\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">.\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">env\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">.\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">MITHUNAI_URL\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">}/mithunai/api/v1/conversations/${\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">conversationId\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">}/messages:stream`\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> method: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'POST'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> headers: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> Authorization: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">`Bearer ${\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">process\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">.\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">env\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">.\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">MITHUNAI_API_KEY\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">}`\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> 'Content-Type'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'application/json'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> body: \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">JSON\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">stringify\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">({\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> text: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'How do I rotate an API key?'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> idempotency_key: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'ticket-4821-q1'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> }),\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">if\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> (\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">!\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">response.ok) \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">throw\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> new\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\"> Error\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">JSON\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">stringify\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">await\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> response.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">json\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">()))\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">const\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> reader\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> =\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> response.body.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">getReader\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">()\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">const\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> decoder\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> =\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> new\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\"> TextDecoder\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">()\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">let\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> buffer \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> ''\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">for\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> (;;) {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> const\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> { \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">done\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">, \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">value\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> } \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> await\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> reader.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">read\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">()\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> if\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> (done) \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">break\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> buffer \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">+=\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> decoder.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">decode\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(value, { stream: \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">true\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> })\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> let\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> boundary\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> while\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> ((boundary \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> buffer.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">indexOf\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\\n\\n\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">)) \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">!==\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> -\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">1\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">) {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> const\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> record\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> =\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> buffer.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">slice\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">0\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">, boundary)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> buffer \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> buffer.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">slice\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(boundary \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">+\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> 2\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> let\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> event \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> ''\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> let\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> data \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> ''\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> for\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> (\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">const\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> line\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> of\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> record.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">split\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\\n\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">)) {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> if\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> (line.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">startsWith\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'event: '\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">)) event \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> line.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">slice\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">7\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> else\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> if\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> (line.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">startsWith\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'data: '\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">)) data \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">=\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> line.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">slice\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">6\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> const\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> payload\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> =\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> JSON\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">parse\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(data)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> if\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> (event \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">===\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> 'answer.delta'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">) process.stdout.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">write\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(payload.text)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> else\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> if\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> (event \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">===\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> 'answer.replaced'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">) process.stdout.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">write\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">`\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\\n\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">[replaced]\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\\n\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">${\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">payload\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">.\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">text\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">}`\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> else\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> if\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> (event \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">===\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> 'answer.completed'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">) console.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">log\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">`\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\\n\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">[${\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">payload\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">.\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">status\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">}]`\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> else\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> if\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> (event \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">===\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> 'answer.interrupted'\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> ||\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> event \u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">===\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> 'answer.error'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> console.\u003c/span>\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">log\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">(\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">`\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\\n\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">[${\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">event\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">}]`\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">, payload)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"200","html":"\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" language=\"text\">\u003ccode language=\"text\" numberOfLines=\"29\">\u003cspan class=\"line\">\u003cspan>id: 1\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>event: message.created\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>data: {\"answer_message_id\":\"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36\",\"conversation_id\":\"c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60\",\"user_message_id\":\"0e6b1d4f-8a27-4c93-b5d0-7f2e9a3c6b18\"}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>id: 2\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>event: answer.started\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>data: {\"answer_message_id\":\"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36\"}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>id: 3\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>event: answer.delta\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>data: {\"text\":\"Mint a new key, move your integration to it, \"}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>id: 4\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>event: answer.sources\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>data: {\"citations\":[{\"anchor\":\"rotation\",\"ordinal\":1,\"score\":0.82,\"snippet\":\"Rotation is mint-then-revoke: create the replacement first, then revoke the old key.\",\"source_id\":\"3d8f2a61-7e4b-4c19-9a05-b6e1d7c2f480\",\"title\":\"Managing API keys\",\"url\":\"https://docs.example.com/admin/api-keys#rotation\"}]}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>id: 5\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>event: answer.delta\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>data: {\"text\":\"then revoke the old key [1].\"}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>id: 6\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>event: answer.sources\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>data: {\"citations\":[{\"anchor\":\"rotation\",\"ordinal\":1,\"score\":0.82,\"snippet\":\"Rotation is mint-then-revoke: create the replacement first, then revoke the old key.\",\"source_id\":\"3d8f2a61-7e4b-4c19-9a05-b6e1d7c2f480\",\"title\":\"Managing API keys\",\"url\":\"https://docs.example.com/admin/api-keys#rotation\"}]}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>id: 7\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>event: answer.completed\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>data: {\"abstained\":false,\"abstention_reason\":null,\"answer_message_id\":\"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36\",\"finish_reason\":\"end_turn\",\"status\":\"answered\"}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>\u003c/span>\u003c/span>\u003c/code>\u003c/pre>"},{"filename":"200 (failure)","html":"\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" language=\"text\">\u003ccode language=\"text\" numberOfLines=\"13\">\u003cspan class=\"line\">\u003cspan>id: 1\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>event: message.created\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>data: {\"answer_message_id\":\"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36\",\"conversation_id\":\"c41f8a2e-6d93-4b0a-b7e5-3f1d2c8a9e60\",\"user_message_id\":\"0e6b1d4f-8a27-4c93-b5d0-7f2e9a3c6b18\"}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>id: 2\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>event: answer.started\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>data: {\"answer_message_id\":\"7c3a9e52-1b6d-4f08-a4e7-2d9b5f1c8e36\"}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>id: 3\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>event: answer.error\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>data: {\"code\":\"provider_failure\",\"message\":\"The upstream provider could not complete the request.\"}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>\u003c/span>\u003c/span>\u003c/code>\u003c/pre>"},{"filename":"409","html":"\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"1\">\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">{ \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\"code\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"conflict\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">, \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\"message\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"This conversation is already waiting for an answer.\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> }\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"429","html":"\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"code\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"quota_exceeded\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"message\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"The monthly answer limit for this account has been reached.\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"404","html":"\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"1\">\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">{ \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\"code\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"not_found\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">, \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\"message\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"The requested resource was not found.\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> }\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Stream an answer as it is being written","path":"/conversations/{conversation_id}/messages:stream","servers":[{"url":"https://app.mithunai.com/mithunai/api/v1"}],"method":"post","request":{"security":[{"title":"Bearer Auth","parameters":{"header":{"Authorization":{"type":"http","scheme":"bearer","description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token."}},"query":{},"cookie":{}}}],"parameters":{"query":{},"header":{},"cookie":{},"path":{"conversation_id":{"schema":[{"type":"string","description":"The conversation ID.","required":true}]}}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"text":[{"type":"string","description":"The question. 1 to 16,000 characters after trimming. Newlines and tabs are allowed; other control characters and invisible formatting characters are rejected.","required":true}],"idempotency_key":[{"type":"string","description":"Your own key for this question, unique within the conversation. Up to 128 characters from `A-Z` , `a-z` , `0-9` , `_` , `.` , `:` and `-` ."}],"metadata":[{"type":"object","properties":{},"description":"Your own labels for the question. At most 20 entries; keys up to 64 characters matching `^[a-z][a-z0-9_.-]*$` ; values up to 512 characters on a single line."}]}}],"examples":{"example":{"value":{"text":"\u003cstring>","idempotency_key":"\u003cstring>","metadata":{}}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"conversation_id":[{"type":"string","description":"The conversation ID.","required":true}],"user_message_id":[{"type":"string","description":"The ID of your question message.","required":true}],"answer_message_id":[{"type":"string","description":"The ID of the answer message.","required":true}],"text":[{"type":"string","description":"The whole answer so far, replacing everything streamed before it.","required":true}],"citations":[{"type":"array","items":[{"type":"object","properties":{"source_id":[{"type":"string","description":"Identifier of the cited passage. It stays the same while the document’s content is unchanged and changes when changed content is re-ingested. It is not a knowledge source ID or a document ID."}],"ordinal":[{"type":"integer","description":"The citation’s number, from 1, matching the `[1]` -style marker in the answer text."}],"title":[{"type":"string","description":"Title of the cited document. May be an empty string."}],"url":[{"type":"object","properties":{},"description":"The source URL, when the document has one."}],"snippet":[{"type":"object","properties":{},"description":"An excerpt supporting the answer."}],"anchor":[{"type":"object","properties":{},"description":"A location within the source, such as a heading or page."}],"score":[{"type":"object","properties":{},"description":"The retrieval relevance score of the cited passage. Higher is more relevant. Use it for diagnostics and ranking, not as a probability."}]}}],"required":true}],"status":[{"type":"string","description":"`answered` , or `abstained` when the assistant declined because your knowledge did not support an answer.","required":true}],"abstained":[{"type":"boolean","description":"`true` for an abstention. An abstention is a successful outcome, not an error; do not present its sources as supporting an answer. See How answers work .","required":true}],"finish_reason":[{"type":"object","properties":{},"description":"Why generation stopped, as reported. `length` means the answer was cut off at the output limit and is incomplete.","required":true}],"abstention_reason":[{"type":"object","properties":{},"description":"Why the assistant declined, or `null` when it declined without naming a reason. Always `null` when `abstained` is `false` . An open string : match the values you know and fall back to a generic notice for one you do not. New values are not a breaking change. Value What it means What changes it `no_evidence` Nothing came back from your sources at all. Connect a source that covers the subject. `below_score_threshold` Passages came back; none was a close enough match. A source that covers it directly, or a lower grounding threshold. `weak_best_match` Passages cleared the floor, but the closest was still only loosely related. A more specific question, or better coverage. `too_few_passages` Fewer passages cleared the bar than the assistant answers from. Coverage in more than one place, or a lower minimum. `model_declined` The passages passed the gate and the model still judged them insufficient. Reword, or improve the source. A retrieval-quality signal, not a coverage gap. `no_supporting_citation` A draft answer cited no real passage, so it was withheld. Nothing on your side — the grounding check working. `unverified_link` The draft contained a link that appears in none of the cited passages. Same. `provider_filtered` The model provider declined to produce output. Reword, or retry. `empty_generation` The provider returned nothing. Retry. The widget surface receives a deliberately coarser set — see Stream a thread message . This is a streaming field only: a message read back from List messages carries `abstained` but no reason, and a replayed idempotent turn sends `null` .","required":true}],"reason":[{"type":"string","description":"Why it stopped: an error code such as `provider_failure` when generation failed part-way, `incomplete_stream` when generation ended without finishing, or `interrupted` on a replayed turn.","required":true}],"code":[{"type":"string","description":"A stable error code, such as `provider_failure` , `retrieval_failure` , `dependency_failure` or `internal_error` . See Errors .","required":true}],"message":[{"type":"string","description":"A client-safe message. It never contains internal detail.","required":true}]}}],"examples":{"example":{"value":{"conversation_id":"\u003cstring>","user_message_id":"\u003cstring>","answer_message_id":"\u003cstring>","text":"\u003cstring>","citations":[{"source_id":"\u003cstring>","ordinal":123,"title":"\u003cstring>","url":{},"snippet":{},"anchor":{},"score":{}}],"status":"\u003cstring>","abstained":true,"finish_reason":{},"abstention_reason":{},"reason":"\u003cstring>","code":"\u003cstring>","message":"\u003cstring>"}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"mithunai","siteName":"MITHUNAI Docs","title":"Stream an answer as it is being written - MITHUNAI Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-12T10:34:30.478Z","gitLastModified":"2026-11-07T13:01:51.000Z","originalFileLocation":"api-reference/conversations/stream-message.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Ask a question and receive the answer as Server-Sent Events while it is generated. Same body and rules as Send a message; only delivery differs.\">\u003cmeta data-mint-head name=\"application-name\" content=\"MITHUNAI Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/mithunai/VSpazMGn_kHl9He0/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/mithunai/VSpazMGn_kHl9He0/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/mithunai/VSpazMGn_kHl9He0/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/mithunai/VSpazMGn_kHl9He0/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/mithunai/VSpazMGn_kHl9He0/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/mithunai/VSpazMGn_kHl9He0/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/mithunai/VSpazMGn_kHl9He0/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/mithunai/VSpazMGn_kHl9He0/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/mithunai/VSpazMGn_kHl9He0/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Stream an answer as it is being written - MITHUNAI Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Ask a question and receive the answer as Server-Sent Events while it is generated. Same body and rules as Send a message; only delivery differs.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"MITHUNAI Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.mithunai.com/api-reference/conversations/stream-message\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://mithunai.mintlify.site/_mintlify/api/og/v2?division=Conversations\u0026amp;title=Stream+an+answer+as+it+is+being+written\u0026amp;description=Ask+a+question+and+receive+the+answer+as+Server-Sent+Events+while+it+is+generated.+Same+body+and+rules+as+Send+a+message%3B+only+delivery+differs.\u0026amp;theme=1766bc81c38ade07d7956bb7\u0026amp;signature=b90be5ada60dc092675187b941621f9e87c509c133c2996f70783b0ce687f067\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Stream an answer as it is being written - MITHUNAI Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Ask a question and receive the answer as Server-Sent Events while it is generated. Same body and rules as Send a message; only delivery differs.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://mithunai.mintlify.site/_mintlify/api/og/v2?division=Conversations\u0026amp;title=Stream+an+answer+as+it+is+being+written\u0026amp;description=Ask+a+question+and+receive+the+answer+as+Server-Sent+Events+while+it+is+generated.+Same+body+and+rules+as+Send+a+message%3B+only+delivery+differs.\u0026amp;theme=1766bc81c38ade07d7956bb7\u0026amp;signature=b90be5ada60dc092675187b941621f9e87c509c133c2996f70783b0ce687f067\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/mithunai/VSpazMGn_kHl9He0/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"MITHUNAI Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#B83E0E\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en_GB\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.mithunai.com/api-reference/conversations/stream-message\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/conversations/stream-message.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://www.mithunai.com/#organization\",\"name\":\"MITHUNAI\",\"url\":\"https://www.mithunai.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://docs.mithunai.com/logo/light.svg\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.mithunai.com#website\",\"name\":\"MITHUNAI Docs\",\"url\":\"https://docs.mithunai.com\",\"publisher\":{\"@id\":\"https://www.mithunai.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.mithunai.com/api-reference/conversations/stream-message#webpage\",\"url\":\"https://docs.mithunai.com/api-reference/conversations/stream-message\",\"name\":\"Stream an answer as it is being written\",\"description\":\"Ask a question and receive the answer as Server-Sent Events while it is generated. Same body and rules as Send a message; only delivery differs.\",\"dateModified\":\"2026-11-07T13:01:51.000Z\",\"isPartOf\":{\"@id\":\"https://docs.mithunai.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.mithunai.com/api-reference/conversations/stream-message#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.mithunai.com/api-reference/conversations/stream-message#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Conversations\",\"item\":\"https://docs.mithunai.com/api-reference/conversations/create-conversation\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Stream an answer as it is being written\",\"item\":\"https://docs.mithunai.com/api-reference/conversations/stream-message\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.mithunai.com/api-reference/conversations/stream-message#apireference\",\"headline\":\"Stream an answer as it is being written\",\"name\":\"Stream an answer as it is being written\",\"description\":\"Ask a question and receive the answer as Server-Sent Events while it is generated. Same body and rules as Send a message; only delivery differs.\",\"url\":\"https://docs.mithunai.com/api-reference/conversations/stream-message\",\"mainEntityOfPage\":{\"@id\":\"https://docs.mithunai.com/api-reference/conversations/stream-message#webpage\"},\"dateModified\":\"2026-11-07T13:01:51.000Z\",\"publisher\":{\"@id\":\"https://www.mithunai.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.mithunai.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"MITHUNAI Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"MITHUNAI\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/conversations/stream-message.md","siteName":"MITHUNAI Docs","nav":{"global":null,"tabs":[{"tab":"Home","icon":"house","pages":[{"title":"Home","href":""}]},{"tab":"RAG","icon":"book-open-check","pages":[{"title":"RAG","href":"/rag/overview"}]},{"tab":"Chat","icon":"message-circle","pages":[{"title":"Chat","href":"/chat/overview"}]},{"tab":"Gateway","icon":"zap","pages":[{"title":"Gateway","href":"/gateway/overview"}]},{"tab":"Agents","icon":"waypoints","pages":[{"title":"Agents","href":"/agents/overview"}]},{"tab":"Team","icon":"users","pages":[{"title":"Team","href":"/team/overview"}]},{"tab":"Platform","icon":"building-2","pages":[{"title":"Platform","href":"/concepts/organizations-and-roles"}]},{"tab":"API reference","icon":"square-terminal","groups":[{"group":"Get started","pages":[{"title":"MITHUNAI HTTP API: base URL and rules","sidebarTitle":"Introduction","icon":"square-terminal","href":"/api-reference/introduction"},{"title":"Authenticate API requests with a key","sidebarTitle":"Authentication","icon":"key-round","href":"/api-reference/authentication"},{"title":"API error codes and how to handle them","sidebarTitle":"Errors","icon":"triangle-alert","href":"/api-reference/errors"},{"title":"Rate limits and handling 429 responses","sidebarTitle":"Rate limits","icon":"gauge","href":"/api-reference/rate-limits"},{"title":"Paginate list endpoints with cursors","sidebarTitle":"Pagination","icon":"list","href":"/api-reference/pagination"},{"title":"Stream answers with server-sent events","sidebarTitle":"Streaming","icon":"radio","href":"/api-reference/streaming"}]},{"group":"Conversations","pages":[{"title":"Start a conversation with an assistant","sidebarTitle":"Start a conversation","api":"POST /conversations","href":"/api-reference/conversations/create-conversation"},{"title":"List the conversations you can see","sidebarTitle":"List conversations","api":"GET /conversations","href":"/api-reference/conversations/list-conversations"},{"title":"Get one conversation and its state","sidebarTitle":"Get a conversation","api":"GET /conversations/{conversation_id}","href":"/api-reference/conversations/get-conversation"},{"title":"Rename, archive or restore a conversation","sidebarTitle":"Update a conversation","api":"PATCH /conversations/{conversation_id}","href":"/api-reference/conversations/update-conversation"},{"title":"Delete a conversation and its messages","sidebarTitle":"Delete a conversation","api":"DELETE /conversations/{conversation_id}","href":"/api-reference/conversations/delete-conversation"},{"title":"Ask a question and get a cited answer","sidebarTitle":"Send a message","api":"POST /conversations/{conversation_id}/messages","description":"Ask a question and receive the whole grounded answer with its citations in one response: the non-streaming turn, for clients without event streams.","href":"/api-reference/conversations/send-message"},{"title":"Stream an answer as it is being written","sidebarTitle":"Stream a message","api":"POST /conversations/{conversation_id}/messages:stream","href":"/api-reference/conversations/stream-message"},{"title":"List the messages in a conversation","sidebarTitle":"List messages","api":"GET /conversations/{conversation_id}/messages","description":"Read a conversation's questions and answers, oldest first, paged by cursor. An answer is recorded before it is generated, so render complete ones.","href":"/api-reference/conversations/list-messages"},{"title":"Rate an answer in a conversation","sidebarTitle":"Rate an answer","api":"PUT /conversations/{conversation_id}/messages/{message_id}/feedback","href":"/api-reference/conversations/rate-message"},{"title":"List the ratings on an answer","sidebarTitle":"List an answer's ratings","api":"GET /conversations/{conversation_id}/messages/{message_id}/feedback","href":"/api-reference/conversations/list-message-ratings"},{"title":"Clear your rating of an answer","sidebarTitle":"Clear a rating","api":"DELETE /conversations/{conversation_id}/messages/{message_id}/feedback","href":"/api-reference/conversations/clear-message-rating"},{"title":"Suggest follow-up questions for an answer","sidebarTitle":"Suggest follow-ups","api":"POST /conversations/{conversation_id}/messages/{message_id}/follow-ups","href":"/api-reference/conversations/suggest-follow-ups"}]},{"group":"Assistants","pages":[{"title":"Create an assistant over your knowledge","sidebarTitle":"Create an assistant","api":"POST /assistants","href":"/api-reference/assistants/create-assistant"},{"title":"List the assistants in your organisation","sidebarTitle":"List assistants","api":"GET /assistants","href":"/api-reference/assistants/list-assistants"},{"title":"Get an assistant and its instruction","sidebarTitle":"Get an assistant","api":"GET /assistants/{assistant_id}","href":"/api-reference/assistants/get-assistant"},{"title":"Change an assistant's knowledge or model","sidebarTitle":"Update an assistant","api":"PATCH /assistants/{assistant_id}","href":"/api-reference/assistants/update-assistant"},{"title":"Get an assistant with its field limits","sidebarTitle":"Get assistant settings","api":"GET /assistants/{assistant_id}/settings","href":"/api-reference/assistants/get-assistant-settings"},{"title":"Run an answer-quality eval on an assistant","sidebarTitle":"Run an eval","api":"POST /assistants/{assistant_id}/evals","href":"/api-reference/assistants/run-assistant-eval"},{"title":"Keep an eval set","sidebarTitle":"Keep an eval set","api":"POST /assistants/{assistant_id}/eval-sets","href":"/api-reference/assistants/save-eval-set"},{"title":"List eval sets","sidebarTitle":"List eval sets","api":"GET /assistants/{assistant_id}/eval-sets","href":"/api-reference/assistants/list-eval-sets"},{"title":"Run a kept eval set","sidebarTitle":"Run a kept eval set","api":"POST /assistants/{assistant_id}/eval-sets/{set_id}/runs","href":"/api-reference/assistants/run-eval-set"},{"title":"List eval runs","sidebarTitle":"List eval runs","api":"GET /assistants/{assistant_id}/eval-runs","href":"/api-reference/assistants/list-eval-runs"},{"title":"Get an eval run","sidebarTitle":"Get an eval run","api":"GET /assistants/{assistant_id}/eval-runs/{run_id}","href":"/api-reference/assistants/get-eval-run"}]},{"group":"Models","pages":[{"title":"List the models an assistant can use","sidebarTitle":"List models","api":"GET /models","href":"/api-reference/models/list-models"},{"title":"List the model providers configured","sidebarTitle":"List providers","api":"GET /models/providers","href":"/api-reference/models/list-providers"},{"title":"Get one model from the catalogue by id","sidebarTitle":"Get a model","api":"GET /models/{provider}/{name}","href":"/api-reference/models/get-model"}]},{"group":"Knowledge","pages":[{"group":"Collections","pages":[{"title":"Create a knowledge collection to ingest into","sidebarTitle":"Create a collection","api":"POST /knowledge/collections","href":"/api-reference/knowledge/create-collection"},{"title":"List all your knowledge collections","sidebarTitle":"List collections","api":"GET /knowledge/collections","href":"/api-reference/knowledge/list-collections"},{"title":"Get one knowledge collection by id","sidebarTitle":"Get a collection","api":"GET /knowledge/collections/{collection_id}","href":"/api-reference/knowledge/get-collection"},{"title":"Rename or archive a knowledge collection","sidebarTitle":"Update a collection","api":"PATCH /knowledge/collections/{collection_id}","href":"/api-reference/knowledge/update-collection"}]},{"group":"Sources","pages":[{"title":"Create a knowledge source to ingest","sidebarTitle":"Create a source","api":"POST /knowledge/sources","href":"/api-reference/knowledge/create-source"},{"title":"List the knowledge sources you have","sidebarTitle":"List sources","api":"GET /knowledge/sources","href":"/api-reference/knowledge/list-sources"},{"title":"Get a knowledge source and its config","sidebarTitle":"Get a source","api":"GET /knowledge/sources/{source_id}","href":"/api-reference/knowledge/get-source"},{"title":"Update, pause or resume a knowledge source","sidebarTitle":"Update a source","api":"PATCH /knowledge/sources/{source_id}","href":"/api-reference/knowledge/update-source"},{"title":"Delete a source and all its documents","sidebarTitle":"Delete a source","api":"DELETE /knowledge/sources/{source_id}","href":"/api-reference/knowledge/delete-source"},{"title":"Sync a source into its collection now","sidebarTitle":"Sync a source","api":"POST /knowledge/sources/{source_id}/sync","href":"/api-reference/knowledge/sync-source"},{"title":"Get a source's latest ingestion job","sidebarTitle":"Get a source's latest job","api":"GET /knowledge/sources/{source_id}/job","href":"/api-reference/knowledge/get-source-job"},{"title":"Confirm the removal a sync held","sidebarTitle":"Confirm a held removal","api":"POST /knowledge/sources/{source_id}/removal/confirm","href":"/api-reference/knowledge/confirm-removal"},{"title":"Keep the documents a sync held for removal","sidebarTitle":"Keep held documents","api":"POST /knowledge/sources/{source_id}/removal/keep","href":"/api-reference/knowledge/keep-held-documents"}]},{"group":"Ingestion jobs","pages":[{"title":"List recent ingestion jobs and runs","sidebarTitle":"List jobs","api":"GET /knowledge/jobs","href":"/api-reference/knowledge/list-jobs"},{"title":"Get an ingestion job and its counters","sidebarTitle":"Get a job","api":"GET /knowledge/jobs/{job_id}","href":"/api-reference/knowledge/get-job"},{"title":"Cancel a running ingestion job early","sidebarTitle":"Cancel a job","api":"POST /knowledge/jobs/{job_id}/cancel","href":"/api-reference/knowledge/cancel-job"}]},{"group":"Documents and uploads","pages":[{"title":"List the documents in a collection","sidebarTitle":"List documents","api":"GET /knowledge/documents","href":"/api-reference/knowledge/list-documents"},{"title":"Read a document's text","sidebarTitle":"Get document content","api":"GET /knowledge/documents/{document_id}/content","href":"/api-reference/knowledge/get-document-content"},{"title":"See who can be answered from a document","sidebarTitle":"Get document access","api":"GET /knowledge/documents/{document_id}/access","href":"/api-reference/knowledge/get-document-access"},{"title":"Upload files for a knowledge collection","sidebarTitle":"Upload files","api":"POST /knowledge/uploads","href":"/api-reference/knowledge/upload-files"},{"title":"Read the file upload size ceilings","sidebarTitle":"Upload limits","api":"GET /knowledge/uploads/limits","playground":"simple","href":"/api-reference/knowledge/upload-limits"}]}]},{"group":"Widget deployments","pages":[{"title":"Publish an assistant as a website widget","sidebarTitle":"Create a widget deployment","api":"POST /widget-deployments","href":"/api-reference/widget-deployments/create-widget-deployment"},{"title":"List all your website widget embeds","sidebarTitle":"List widget deployments","api":"GET /widget-deployments","href":"/api-reference/widget-deployments/list-widget-deployments"},{"title":"Get a widget embed and its widget key","sidebarTitle":"Get a widget deployment","api":"GET /widget-deployments/{deployment_id}","href":"/api-reference/widget-deployments/get-widget-deployment"},{"title":"Change a widget embed's allowed origins","sidebarTitle":"Update a widget deployment","api":"PATCH /widget-deployments/{deployment_id}","href":"/api-reference/widget-deployments/update-widget-deployment"},{"title":"Revoke a website widget embed for good","sidebarTitle":"Revoke a widget deployment","api":"DELETE /widget-deployments/{deployment_id}","href":"/api-reference/widget-deployments/revoke-widget-deployment"},{"title":"Check that a widget embed is installed on a page","sidebarTitle":"Check an installation","api":"POST /widget-deployments/{deployment_id}/installation-check","href":"/api-reference/widget-deployments/check-widget-installation"}]},{"group":"Widget (public)","pages":[{"title":"Bootstrap the widget on a visitor's page","sidebarTitle":"Bootstrap the widget","api":"GET /widget/bootstrap","playground":"simple","href":"/api-reference/widget/bootstrap"},{"title":"Start a widget thread for a visitor","sidebarTitle":"Start a widget conversation","api":"POST /widget/conversations","playground":"simple","href":"/api-reference/widget/start-thread"},{"title":"List one visitor's own widget threads","sidebarTitle":"List widget conversations","api":"GET /widget/conversations","playground":"simple","href":"/api-reference/widget/list-threads"},{"title":"Get one widget conversation thread","sidebarTitle":"Get a widget conversation","api":"GET /widget/conversations/{conversation_id}","playground":"simple","href":"/api-reference/widget/get-thread"},{"title":"Ask a question from the website widget","sidebarTitle":"Send a widget message","api":"POST /widget/conversations/{conversation_id}/messages","playground":"simple","href":"/api-reference/widget/send-thread-message"},{"title":"Stream a widget answer to a visitor","sidebarTitle":"Stream a widget message","api":"POST /widget/conversations/{conversation_id}/messages:stream","playground":"simple","href":"/api-reference/widget/stream-thread-message"},{"title":"List the messages in a widget thread","sidebarTitle":"List widget messages","api":"GET /widget/conversations/{conversation_id}/messages","playground":"simple","href":"/api-reference/widget/list-thread-messages"},{"title":"Rate an answer in a widget thread","sidebarTitle":"Rate a widget answer","api":"PUT /widget/conversations/{conversation_id}/messages/{message_id}/feedback","playground":"simple","href":"/api-reference/widget/rate-thread-message"},{"title":"Record what a visitor did after the form deflector answered","sidebarTitle":"Record a deflection","api":"POST /widget/conversations/{conversation_id}/deflection","playground":"simple","href":"/api-reference/widget/record-deflection"},{"title":"Get the visitor's rating of a widget answer","sidebarTitle":"Get a widget answer's rating","api":"GET /widget/conversations/{conversation_id}/messages/{message_id}/feedback","playground":"simple","href":"/api-reference/widget/get-thread-message-rating"},{"title":"Withdraw the visitor's rating of a widget answer","sidebarTitle":"Withdraw a widget answer's rating","api":"DELETE /widget/conversations/{conversation_id}/messages/{message_id}/feedback","playground":"simple","href":"/api-reference/widget/clear-thread-message-rating"}]},{"group":"MCP","pages":[{"title":"MCP endpoint: JSON-RPC methods and tools","sidebarTitle":"MCP","api":"POST /mcp","href":"/api-reference/mcp/mcp"}]},{"group":"Connections","pages":[{"title":"Save a connection to Atlassian, Notion, Zendesk or GitHub","sidebarTitle":"Save a connection","api":"POST /connections","playground":"none","href":"/api-reference/connections/create-connection"},{"title":"List your organisation's saved connections","sidebarTitle":"List connections","api":"GET /connections","playground":"simple","href":"/api-reference/connections/list-connections"},{"title":"Read a saved connection's details","sidebarTitle":"Get a connection","api":"GET /connections/{connection_id}","playground":"simple","href":"/api-reference/connections/get-connection"},{"title":"Replace a connection's token","sidebarTitle":"Replace a token","api":"POST /connections/{connection_id}/rotate","playground":"none","href":"/api-reference/connections/rotate-connection"},{"title":"Delete a connection no source uses","sidebarTitle":"Delete a connection","api":"DELETE /connections/{connection_id}","playground":"none","href":"/api-reference/connections/delete-connection"},{"title":"List your saved AI provider keys","sidebarTitle":"List model keys","api":"GET /model-keys","playground":"none","href":"/api-reference/model-keys/list-model-keys"},{"title":"Save or replace an AI provider key","sidebarTitle":"Save a model key","api":"POST /model-keys","playground":"none","href":"/api-reference/model-keys/save-model-key"},{"title":"Remove an AI provider key","sidebarTitle":"Remove a model key","api":"DELETE /model-keys/{provider}","playground":"none","href":"/api-reference/model-keys/delete-model-key"},{"title":"Test a saved AI provider key","sidebarTitle":"Test a model key","api":"POST /model-keys/test","playground":"none","href":"/api-reference/model-keys/test-model-key"}]},{"group":"Slack","pages":[{"title":"Read the Slack connection","sidebarTitle":"Get the Slack connection","api":"GET /integrations/slack","href":"/api-reference/slack/get-slack"},{"title":"Start connecting Slack","sidebarTitle":"Start connecting","api":"POST /integrations/slack/install","playground":"none","href":"/api-reference/slack/start-install"},{"title":"Finish connecting Slack","sidebarTitle":"Finish connecting","api":"POST /integrations/slack/complete","playground":"none","href":"/api-reference/slack/complete-install"},{"title":"Choose the assistant that answers in Slack","sidebarTitle":"Choose the assistant","api":"PATCH /integrations/slack","href":"/api-reference/slack/update-slack"},{"title":"Disconnect Slack","sidebarTitle":"Disconnect","api":"DELETE /integrations/slack","href":"/api-reference/slack/remove-slack"},{"title":"Read your linked Slack account","sidebarTitle":"Get your Slack link","api":"GET /integrations/slack/identity","playground":"none","href":"/api-reference/slack/get-identity"},{"title":"Check a Slack link before confirming it","sidebarTitle":"Check a Slack link","api":"POST /integrations/slack/identity/preview","playground":"none","href":"/api-reference/slack/preview-identity"},{"title":"Start linking your Slack account","sidebarTitle":"Link your Slack account","api":"POST /integrations/slack/identity","playground":"none","href":"/api-reference/slack/link-identity"},{"title":"Unlink your Slack account","sidebarTitle":"Unlink your Slack account","api":"DELETE /integrations/slack/identity","playground":"none","href":"/api-reference/slack/unlink-identity"},{"title":"Receive an event from Slack","sidebarTitle":"Receive an event","api":"POST /slack/events","playground":"none","href":"/api-reference/slack/receive-event"},{"title":"Receive a press on an approval card from Slack","sidebarTitle":"Receive a card press","api":"POST /slack/interactions","playground":"none","href":"/api-reference/slack/receive-interaction"}]},{"group":"Microsoft Teams","pages":[{"title":"Read the Microsoft Teams connection","sidebarTitle":"Get the Teams connection","api":"GET /integrations/teams","playground":"none","href":"/api-reference/teams/get-teams"},{"title":"Start connecting Microsoft Teams","sidebarTitle":"Start connecting","api":"POST /integrations/teams/install","playground":"none","href":"/api-reference/teams/start-install"},{"title":"Finish connecting Microsoft Teams","sidebarTitle":"Finish connecting","api":"POST /integrations/teams/complete","playground":"none","href":"/api-reference/teams/complete-install"},{"title":"Choose the assistant that answers in Microsoft Teams","sidebarTitle":"Choose the assistant","api":"PATCH /integrations/teams","playground":"none","href":"/api-reference/teams/update-teams"},{"title":"Disconnect Microsoft Teams","sidebarTitle":"Disconnect","api":"DELETE /integrations/teams","playground":"none","href":"/api-reference/teams/remove-teams"},{"title":"Read your linked Teams account","sidebarTitle":"Get your Teams link","api":"GET /integrations/teams/identity","playground":"none","href":"/api-reference/teams/get-identity"},{"title":"Check a Teams link before confirming it","sidebarTitle":"Check a Teams link","api":"POST /integrations/teams/identity/preview","playground":"none","href":"/api-reference/teams/preview-identity"},{"title":"Start linking your Teams account","sidebarTitle":"Link your Teams account","api":"POST /integrations/teams/identity","playground":"none","href":"/api-reference/teams/link-identity"},{"title":"Unlink your Teams account","sidebarTitle":"Unlink your Teams account","api":"DELETE /integrations/teams/identity","playground":"none","href":"/api-reference/teams/unlink-identity"},{"title":"Receive an activity from Microsoft Teams","sidebarTitle":"Receive an activity","api":"POST /teams/messages","playground":"none","href":"/api-reference/teams/receive-activity"}]},{"group":"API keys","pages":[{"title":"Create an API key and read its secret","sidebarTitle":"Create an API key","api":"POST /api-keys","playground":"simple","href":"/api-reference/api-keys/create-api-key"},{"title":"List your organisation's own API keys","sidebarTitle":"List API keys","api":"GET /api-keys","playground":"simple","href":"/api-reference/api-keys/list-api-keys"},{"title":"Read an API key without its secret","sidebarTitle":"Get an API key","api":"GET /api-keys/{api_key_id}","playground":"simple","href":"/api-reference/api-keys/get-api-key"},{"title":"Revoke a leaked or unused API key now","sidebarTitle":"Revoke an API key","api":"DELETE /api-keys/{api_key_id}","playground":"simple","href":"/api-reference/api-keys/revoke-api-key"}]},{"group":"Members","pages":[{"title":"List your organisation's members","sidebarTitle":"List members","api":"GET /members","playground":"simple","href":"/api-reference/members/list-members"},{"title":"Add a member, by invitation","sidebarTitle":"Add a member","api":"POST /members","playground":"simple","href":"/api-reference/members/add-member"},{"title":"Change a member's role","sidebarTitle":"Change a role","api":"PATCH /members/{account_id}","playground":"simple","href":"/api-reference/members/change-member-role"},{"title":"Remove a member from your organisation","sidebarTitle":"Remove a member","api":"DELETE /members/{account_id}","playground":"simple","href":"/api-reference/members/remove-member"},{"title":"Make a member the owner of your organisation","sidebarTitle":"Make a member the owner","api":"POST /members/{account_id}/make-owner","playground":"simple","href":"/api-reference/members/make-owner"},{"title":"List your organisation's products","sidebarTitle":"List products","api":"GET /products","href":"/api-reference/members/get-products"}]},{"group":"Invitations","pages":[{"title":"List invitations that have not been accepted","sidebarTitle":"List invitations","api":"GET /invitations","playground":"simple","href":"/api-reference/invitations/list-invitations"},{"title":"Invite a person by email","sidebarTitle":"Send an invitation","api":"POST /invitations","playground":"simple","href":"/api-reference/invitations/create-invitation"},{"title":"Send an invitation again","sidebarTitle":"Re-send an invitation","api":"POST /invitations/{invitation_id}/resend","playground":"simple","href":"/api-reference/invitations/resend-invitation"},{"title":"Withdraw an invitation","sidebarTitle":"Withdraw an invitation","api":"DELETE /invitations/{invitation_id}","playground":"simple","href":"/api-reference/invitations/revoke-invitation"}]},{"group":"Analytics","pages":[{"title":"Get usage counts for a time window","sidebarTitle":"Get usage","api":"GET /analytics/usage","href":"/api-reference/analytics/get-usage"},{"title":"Get this month's answers against your allowance","sidebarTitle":"Get answer allowance","api":"GET /usage","href":"/api-reference/analytics/get-answer-allowance"},{"title":"Get your plan, its limits and what is in use","sidebarTitle":"Get plan","api":"GET /plan","href":"/api-reference/analytics/get-plan"},{"title":"Get your AI budget and gateway controls","sidebarTitle":"Get AI gateway controls","api":"GET /ai-gateway","href":"/api-reference/analytics/get-ai-gateway"},{"title":"List the questions nobody could answer","sidebarTitle":"List unanswered questions","api":"GET /analytics/unanswered","href":"/api-reference/analytics/list-unanswered"},{"title":"List the questions people ask most","sidebarTitle":"List top questions","api":"GET /analytics/top-questions","href":"/api-reference/analytics/list-top-questions"},{"title":"List coverage gaps to answer","sidebarTitle":"List doc proposals","api":"GET /analytics/doc-proposals","href":"/api-reference/analytics/list-doc-proposals"},{"title":"Draft an answer for a coverage gap","sidebarTitle":"Draft a doc proposal","api":"POST /analytics/doc-proposals/draft","href":"/api-reference/analytics/draft-doc-proposal"},{"title":"Publish an answer for a coverage gap","sidebarTitle":"Publish a doc proposal","api":"POST /analytics/doc-proposals/publish","href":"/api-reference/analytics/publish-doc-proposal"},{"title":"Dismiss a coverage gap","sidebarTitle":"Dismiss a doc proposal","api":"POST /analytics/doc-proposals/dismiss","href":"/api-reference/analytics/dismiss-doc-proposal"},{"title":"Get the sources and documents answers cited","sidebarTitle":"Get source analytics","api":"GET /analytics/sources","href":"/api-reference/analytics/get-source-analytics"}]},{"group":"Support access","pages":[{"title":"Read who from support can see your data","sidebarTitle":"Read support access","api":"GET /support-access","playground":"simple","href":"/api-reference/support-access/get-support-access"},{"title":"Allow or withdraw MITHUNAI support access","sidebarTitle":"Allow or withdraw","api":"PUT /support-access","playground":"simple","href":"/api-reference/support-access/set-support-access"},{"title":"End one live MITHUNAI support session","sidebarTitle":"End a session","api":"DELETE /support-access/sessions/{session_id}","playground":"simple","href":"/api-reference/support-access/end-support-session"},{"title":"Read what a support session looked at","sidebarTitle":"Session activity","api":"GET /support-access/sessions/{session_id}/activity","playground":"simple","href":"/api-reference/support-access/get-session-activity"}]},{"group":"Audit log","pages":[{"title":"Export the audit log as CSV or JSON Lines","sidebarTitle":"Export the audit log","api":"GET /audit-log/export","href":"/api-reference/audit-log/export-audit-log"}]},{"group":"AI search visibility","pages":[{"title":"Get the set-up","sidebarTitle":"Get set-up","api":"GET /geo","href":"/api-reference/geo/get-geo"},{"title":"Choose engines, samples and schedule","sidebarTitle":"Choose engines","api":"PUT /geo/settings","href":"/api-reference/geo/update-settings"},{"title":"Track your brand or a competitor","sidebarTitle":"Track a name","api":"POST /geo/entities","href":"/api-reference/geo/create-entity"},{"title":"Stop tracking a name","sidebarTitle":"Stop tracking a name","api":"DELETE /geo/entities/{entity_id}","href":"/api-reference/geo/delete-entity"},{"title":"Track a question","sidebarTitle":"Track a question","api":"POST /geo/prompts","href":"/api-reference/geo/create-prompt"},{"title":"Pause or resume a question","sidebarTitle":"Pause a question","api":"PATCH /geo/prompts/{prompt_id}","href":"/api-reference/geo/update-prompt"},{"title":"Stop tracking a question","sidebarTitle":"Stop tracking a question","api":"DELETE /geo/prompts/{prompt_id}","href":"/api-reference/geo/delete-prompt"},{"title":"Run a check now","sidebarTitle":"Run a check","api":"POST /geo/runs","href":"/api-reference/geo/create-run"},{"title":"List checks","sidebarTitle":"List checks","api":"GET /geo/runs","href":"/api-reference/geo/list-runs"},{"title":"Get share of model","sidebarTitle":"Get share of model","api":"GET /geo/report","href":"/api-reference/geo/get-report"},{"title":"List gaps","sidebarTitle":"List gaps","api":"GET /geo/gaps","href":"/api-reference/geo/list-gaps"},{"title":"Draft a fix for an AI search gap","sidebarTitle":"Draft a fix","api":"POST /geo/fixes/draft","href":"/api-reference/geo/draft-fix"},{"title":"Propose an AI search fix for approval","sidebarTitle":"Propose a fix","api":"POST /geo/fixes","href":"/api-reference/geo/propose-fix"}]},{"group":"AI employees","pages":[{"title":"List AI employees","sidebarTitle":"List employees","api":"GET /employees","href":"/api-reference/employees/list-employees"},{"title":"Get an AI employee","sidebarTitle":"Get an employee","api":"GET /employees/{role}","href":"/api-reference/employees/get-employee"},{"title":"Hand an AI employee a piece of work","sidebarTitle":"Hand over work","api":"POST /employees/{role}/tasks","href":"/api-reference/employees/submit-task"},{"title":"List AI-employee tasks","sidebarTitle":"List tasks","api":"GET /employees/tasks","href":"/api-reference/employees/list-tasks"},{"title":"Get an AI-employee task","sidebarTitle":"Get a task","api":"GET /employees/tasks/{task_id}","href":"/api-reference/employees/get-task"},{"title":"List the approval queue","sidebarTitle":"List approvals","api":"GET /employees/approvals","href":"/api-reference/employees/list-approvals"},{"title":"Approve an action","sidebarTitle":"Approve","api":"POST /employees/approvals/{action_id}/approve","href":"/api-reference/employees/approve-action"},{"title":"Reject an action","sidebarTitle":"Reject","api":"POST /employees/approvals/{action_id}/reject","href":"/api-reference/employees/reject-action"},{"title":"Read the activity record","sidebarTitle":"Activity record","api":"GET /employees/activity","href":"/api-reference/employees/list-activity"},{"title":"Get the approval policy","sidebarTitle":"Get policy","api":"GET /employees/policy","href":"/api-reference/employees/get-policy"},{"title":"Change the approval policy","sidebarTitle":"Change policy","api":"PUT /employees/policy","href":"/api-reference/employees/set-policy"},{"title":"List approval rules","sidebarTitle":"List approval rules","api":"GET /employees/approval-rules","href":"/api-reference/employees/list-approval-rules"},{"title":"Set an approval rule","sidebarTitle":"Set approval rule","api":"PUT /employees/{role}/approval-rules/{action_type}","href":"/api-reference/employees/set-approval-rule"},{"title":"Revoke an approval rule","sidebarTitle":"Revoke approval rule","api":"DELETE /employees/approval-rules/{action_type}","href":"/api-reference/employees/revoke-approval-rule"},{"title":"Get the Sales qualification rules","sidebarTitle":"Get qualification rules","api":"GET /employees/sales/qualification-rules","href":"/api-reference/employees/get-qualification-rules"},{"title":"Replace the Sales qualification rules","sidebarTitle":"Replace qualification rules","api":"PUT /employees/sales/qualification-rules","href":"/api-reference/employees/set-qualification-rules"},{"title":"Connect a tool","sidebarTitle":"Connect a tool","api":"PUT /employees/{role}/tools/{tool}","href":"/api-reference/employees/attach-tool"},{"title":"Disconnect a tool","sidebarTitle":"Disconnect a tool","api":"DELETE /employees/{role}/tools/{tool}/{kind}","href":"/api-reference/employees/detach-tool"},{"title":"Test a connected tool","sidebarTitle":"Test a connected tool","api":"POST /employees/{role}/tools/{tool}/{kind}/test","href":"/api-reference/employees/test-tool"},{"title":"List scheduled briefs","sidebarTitle":"List schedules","api":"GET /employees/schedules","href":"/api-reference/employees/list-schedules"},{"title":"Add a scheduled brief","sidebarTitle":"Add schedule","api":"POST /employees/{role}/schedules","href":"/api-reference/employees/add-schedule"},{"title":"Pause a scheduled brief","sidebarTitle":"Pause schedule","api":"POST /employees/schedules/{schedule_id}/pause","href":"/api-reference/employees/pause-schedule"},{"title":"Resume a scheduled brief","sidebarTitle":"Resume schedule","api":"POST /employees/schedules/{schedule_id}/resume","href":"/api-reference/employees/resume-schedule"},{"title":"Remove a scheduled brief","sidebarTitle":"Remove schedule","api":"DELETE /employees/schedules/{schedule_id}","href":"/api-reference/employees/remove-schedule"},{"title":"Read the daily summary setting","sidebarTitle":"Get daily summary","api":"GET /employees/digest","href":"/api-reference/employees/get-digest"},{"title":"Switch the daily summary","sidebarTitle":"Set daily summary","api":"PUT /employees/digest","href":"/api-reference/employees/set-digest"},{"title":"Read whether new tickets are picked up","sidebarTitle":"Get ticket pickup","api":"GET /employees/support/intake","href":"/api-reference/employees/get-ticket-intake"},{"title":"Turn picking up new tickets on or off","sidebarTitle":"Set ticket pickup","api":"PUT /employees/support/intake","href":"/api-reference/employees/set-ticket-intake"},{"title":"Read how many alerts came in","sidebarTitle":"Get alerts","api":"GET /employees/devops/alerts","href":"/api-reference/employees/get-alert-intake"},{"title":"Send an alert to the DevOps employee","sidebarTitle":"Send an alert","api":"POST /employees/devops/alerts","href":"/api-reference/employees/send-alert"},{"title":"Receive an alert from Sentry","sidebarTitle":"Sentry webhook","api":"POST /employees/devops/webhooks/sentry/{credential_id}","href":"/api-reference/employees/receive-sentry-webhook"},{"title":"Receive an incident from PagerDuty","sidebarTitle":"PagerDuty webhook","api":"POST /employees/devops/webhooks/pagerduty/{credential_id}","href":"/api-reference/employees/receive-pagerduty-webhook"},{"title":"Draft a postmortem","sidebarTitle":"Draft a postmortem","api":"POST /employees/devops/postmortems","href":"/api-reference/employees/draft-postmortem"},{"title":"Start connecting your books","sidebarTitle":"Start connecting your books","api":"POST /employees/finance/connections/{credential_id}/consent","href":"/api-reference/employees/start-books-consent"},{"title":"Finish connecting your books","sidebarTitle":"Finish connecting your books","api":"POST /employees/finance/consent/complete","href":"/api-reference/employees/complete-books-consent"},{"title":"Read the confidence threshold","sidebarTitle":"Read confidence threshold","api":"GET /employees/support/confidence","href":"/api-reference/employees/get-confidence-threshold"},{"title":"Set the confidence threshold","sidebarTitle":"Set confidence threshold","api":"PUT /employees/support/confidence","href":"/api-reference/employees/set-confidence-threshold"},{"title":"List tests on past tickets","sidebarTitle":"List tests","api":"GET /employees/support/simulations","href":"/api-reference/employees/list-simulations"},{"title":"Start a simulation on past solved tickets","sidebarTitle":"Start a test","api":"POST /employees/support/simulations","href":"/api-reference/employees/start-simulation"},{"title":"Read a test on past tickets","sidebarTitle":"Read a test","api":"GET /employees/support/simulations/{run_id}","href":"/api-reference/employees/get-simulation"},{"title":"Judge a simulated reply","sidebarTitle":"Judge a reply","api":"PUT /employees/support/simulations/{run_id}/tickets/{reference}/verdict","href":"/api-reference/employees/judge-simulated-ticket"}]},{"group":"Branding","pages":[{"title":"Get your organisation's brand overrides","sidebarTitle":"Get branding","api":"GET /branding","href":"/api-reference/branding/get-branding"},{"title":"Get branding with its value limits","sidebarTitle":"Get branding settings","api":"GET /branding/settings","href":"/api-reference/branding/get-branding-settings"},{"title":"Replace your whole branding layer at once","sidebarTitle":"Replace branding","api":"PUT /branding","href":"/api-reference/branding/replace-branding"},{"title":"Reset branding to the platform default","sidebarTitle":"Reset branding","api":"DELETE /branding","href":"/api-reference/branding/reset-branding"},{"title":"Get your organization's resolved theme","sidebarTitle":"Get the resolved theme","api":"GET /branding/theme","href":"/api-reference/branding/get-theme"},{"title":"Get the deployment's theme without signing in","sidebarTitle":"Get the public theme","api":"GET /branding/public-theme","href":"/api-reference/branding/get-public-theme"}]},{"group":"Operations","pages":[{"title":"Health check for a load balancer probe","sidebarTitle":"Health check","api":"GET /health","playground":"simple","href":"/api-reference/operations/health"},{"title":"Readiness check for an orchestrator","sidebarTitle":"Readiness check","api":"GET /ready","playground":"simple","href":"/api-reference/operations/ready"}]}]}]},"basePath":"","title":"Stream an answer as it is being written - MITHUNAI Docs","buildId":"dpl_8hoxaqFTU7hTr6A2fUraxAyjuiZo","deploymentId":"dpl_8hoxaqFTU7hTr6A2fUraxAyjuiZo","dynamics":["c2aa737661","b0f84f53ff","2b790eda92"],"chunks":["OpenApiReferenceProvider-CDiBsYGW.js","utils-KF9rPlmF.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-C26urKTX.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-BdjmJAC1.js","snippetPresets-3IpDBjt3.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","Page-1CZdsdAn.js","ApiExamples-D4x_2vvo.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BIWdc5Pa.js","shallow-LQqfiMNd.js","getApiPlaygroundDisplay-DryzlOZG.js","CodeSnippet-tcJujU4r.js","CodeSnippets-BHp0nVLL.js","getPastedJson-DU-1ayUv.js","icon-CZK2hPr4.js","MethodPill-DOaqmTFC.js","DuplicateIcon-B5-nUxxl.js","createIcon-CDP_U77G.js","DynamicMarkdown-GHvayGOn.js","SectionHeading-BYvpkmUD.js","axios-vUo_bRtp.js"]}