Skip to main content
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 @- <<EOF
{
  "input": "Tell me about renewable energy",
  "schema": {
    "type": "object",
    "title": "User Profile",
    "description": "A user profile object",
    "properties": {
      "name": {
        "type": "string",
        "description": "The user's full name"
      },
      "age": {
        "type": "number",
        "description": "The user's age"
      },
      "interests": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "List of user interests"
      }
    },
    "required": [
      "name",
      "age"
    ]
  },
  "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"
}
EOF
{
  "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 string 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.

Example:
{
"type": "object",
"title": "User Profile",
"description": "A user profile object",
"properties": {
"name": {
"type": "string",
"description": "The user's full name"
},
"age": {
"type": "number",
"description": "The user's age"
},
"interests": {
"type": "array",
"items": { "type": "string" },
"description": "List of user interests"
}
},
"required": ["name", "age"]
}
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