200 means the stream opened, not that a function is ready.
Both endpoints below use Authorization: Bearer $NOTTE_API_KEY. Keep that key on your server; do not embed a shared key in a public web client.
Choose a transport
The formats differ. Do not use a parser that expects named
event: result frames for the AI SDK stream. The public OpenAPI specification describes the first endpoint and its event payloads.
Simple build stream
Send aquery describing the function you want. curl -N disables output buffering so events appear as they arrive.
Content-Type: text/event-stream. Each event ends with a blank line. Representative frames:
error event instead of a result:
data: using the event name from event:. Progress is informational; only result or error is terminal. Check for an HTTP rejection before reading the stream, and handle errors inside a stream that already returned 200.
Full agent stream
The default response from/api/anything/start is streaming. Omit detach, or set it to false.
x-thread-id response header. This endpoint uses the AI SDK UI-message wire format but does not forward the x-vercel-ai-ui-message-stream header, so do not require that header in your client. The stream format is separate from the retired Anything API v1 backend.
JSON chunks arrive in data: frames. Relevant chunks include:
Detect verified completion
Track thetoolCallId of a tool-input-available chunk whose toolName is complete_build. Its successful tool-output-available output contains a JSON object, possibly encoded as a string, with:
thread_id as the response header and a nonempty function ID and version. Wait for normal stream termination, and treat any subsequent error as a failure. Do not infer success from an arbitrary tool’s stdout or an early deployment event.
A turn can finish normally after the agent explains a blocker, without a stream error. If no successful complete_build result arrived, report that the run ended without a verified function and show the agent’s explanation.
Python reader
This server-side example usesrequests. Its line iterator handles network chunk boundaries; collect data: lines until the blank line that terminates each SSE frame.
Detached builds and follow-ups
POST /api/anything/start also accepts detach: true. It returns 202 Accepted immediately:
started acknowledges submission only. The returned URL opens the thread in the app. There is no documented public polling endpoint to recover a detached build’s final status or transcript. Choose streaming when your client needs the outcome programmatically; detached mode does not return a stream to consume later.
To send a follow-up after the turn finishes, call /api/anything/start again with a new query and the saved thread_id. This starts another agent turn in the same thread; it is not a read-only status request or stream reconnection.
For unattended builds, make that constraint explicit in query: describe the inputs, expected output, authentication available to the run, whether a new function is required, visibility, and how the agent should report missing prerequisites without asking for human input.