Say something to the batch's director
const url = 'http://localhost:8300/v1/studio/batches/example/chat';const options = { method: 'POST', headers: { 'x-api-key': '<x-api-key>', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"text":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8300/v1/studio/batches/example/chat \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "text": "example" }'It; the director wakes (the messages that arrive while it thinks are read on its next wake) and answers with a chat event. It never waits on runs: it answers, searches, reads and writes memory, adds rows and changes rows not yet started (each through Submit’s checks; a rejected row gets a notice with the reason). 409 when the batch has ended or the director is off (the director is off: <why>), and when the chat holds 500 user messages (this chat is full; the director’s replies and notices never count); 429 above 6 messages a minute per batch (at most 6 messages a minute); 422 for a blank text.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Batch UUID (malformed = 404)
Request Bodyrequired
Section titled “Request Bodyrequired”object
Trimmed; blank = 422
Example generated
{ "text": "example"}Responses
Section titled “Responses”Your message, stored
One message of a batch’s director chat
object
Notice: the director’s system line (a row it added or changed was rejected, with the reason; a cap ended its wake)
Director and notice: the wake it came from; null for the user’s
Director: the wake’s tool calls
One tool call an agent made, as run
object
object
Rows it added or changed in that wake
Example
{ "role": "user", "tool_calls": [ { "tool": "gallery_search" } ]}Missing or invalid x-api-key (Kong), or missing/invalid/expired/revoked bearer token
object
Example generated
{ "detail": "example"}Not found
object
Example generated
{ "detail": "example"}The resource’s state forbids this
object
Example generated
{ "detail": "example"}Invalid input
object
Example generated
{ "detail": "example"}A per-resource rate limit
object
Example generated
{ "detail": "example"}Retryable
object
Example generated
{ "detail": "example"}