POST
/
api
/
v1
/
stream
/
object
Stream object
curl --request POST \
  --url https://itz.am/api/v1/stream/object \
  --header 'Api-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "input": "Tell me about renewable energy",
  "attachments": [
    {
      "file": "file_data",
      "mimeType": "application/pdf"
    },
    {
      "file": "image_data",
      "mimeType": "image/png"
    },
    {
      "file": "https://example.com/image.jpg"
    }
  ],
  "contextSlugs": [
    "special-docs",
    "admin-files"
  ],
  "workflowSlug": "my_great_workflow",
  "threadId": "thread_1234567890",
  "schema": "<any>"
}'
{
  "type": "<string>",
  "object": {
    "text": "<string>"
  }
}

Authorizations

Api-Key
string
header
required

The API key to use for authentication

Body

application/json
input
string
required

The input text to generate a response for

Minimum length: 1
Example:

"Tell me about renewable energy"

schema
any
required

A valid JSON Schema object defining the structure of the expected response. Must have a 'type' property set to 'object', 'array', or 'string' (with enum). See https://json-schema.org/ for full specification.

attachments
object[]

Optional attachments to include in the generation

Example:
[
{
"file": "file_data",
"mimeType": "application/pdf"
},
{
"file": "image_data",
"mimeType": "image/png"
},
{ "file": "https://example.com/image.jpg" }
]
contextSlugs
string[]

Optional context slugs to add contexts to the run

Example:
["special-docs", "admin-files"]
workflowSlug
string

The slug of the Workflow to use for generation (required if threadId is not provided)

Example:

"my_great_workflow"

threadId
string

Optional thread ID to associate this run with a conversation thread (required if workflowSlug is not provided)

Example:

"thread_1234567890"

Response

Successfully streaming content

type
string
required
Allowed value: "object"
object
object
required