palbaseDocs

Palbase ai · API

GET/ai/responses/{response_id}/live

Follow a response as it is produced

The response's live view from a byte offset of its answer: every fragment as the model produces it, then the response at its end. A finished response answers its terminal at once.

Called by your server, with the project's secret key.

Path

response_idstring · requiredThe response's id.

Query

offsetinteger · optionalThe byte offset of the answer the caller already holds.
curl
curl -X GET "https://<your-ref>.palbase.studio/ai/responses/<response_id>/live" \
  -H "apikey: $PALBASE_SECRET_KEY"

Responses

200Server-sent events, in this order: `response` (the Response as admitted), `delta` ({offset, text}: a fragment of the answer at its byte offset), `reset` ({offset}: discard what you hold past the offset — a model call was made again), `terminal` (the Response at its end), and `: heartbeat` comments. A stream cut before its terminal is followed again with GET /ai/responses/{response_id}/live?offset=<bytes held>: the response itself never stopped.

400The request is malformed, or names what this module does not offer (the error names which)

401No valid credential

403A publishable key or a user's session: everything here is the project's server's, called with the secret key

404No such response, job or provider in this project

429The project's request rate, or the provider's for its connection, is used up — or the project holds as much as it may at once: 32 open streams at one of the module's servers (too_many_streams), 2 pictures being made (too_many_images), 512 MiB of pictures kept here for their day (image_storage_full), or the service — or the project's share of it — holds as much of its requests at once as it takes: their bodies, an embedding request's vectors, the pictures being made (busy). Retry-After says when to try again

503The model service or the database did not answer; retry shortly

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation FollowResponse of ai's contract.