v2

latestOpenAPI 3.1.02026-07-2670186350.6 KB
functions

Stream Function

Stream a function call execution in real-time using Server-Sent Events (SSE).

This endpoint returns a continuous stream of Server-Sent Event objects as the function executes, allowing for real-time streaming of responses. The response follows the Server-Sent Events specification with proper event structure for SDK compatibility.

Each Server-Sent Event contains:

  • id: Optional event identifier
  • event: Optional event type
  • data: JSON payload with streaming chunk information
  • retry: Optional retry interval

The data payload includes:

  • delta: Incremental text content (if any)
  • span_id: Unique identifier for the execution span (when available)
post/functions/{function_id}/call/stream

Path parameters

function_idstring uuid required

The id of the function to call

The id of the function to call

Request body

{"stackTrail":"components:schemas:app__api__public__v2__functions__CallFunctionRequest:properties:input:anyOf","oasType":"schema","type":"unknown","title":"Input","description":"Input to the function","example":{"x":4,"y":5},"nullable":true}
parent_span_idstring uuid nullable
tagsobject nullable

Tags to add to the call event

Example request

{
  "input": {
    "x": 4,
    "y": 5
  },
  "examples": [
    {
      "comment": "Adds two numbers",
      "input": {
        "x": 1,
        "y": 3
      },
      "output": {
        "sum": 4
      }
    }
  ],
  "tags": {
    "tag": "value"
  }
}

Response

Server-Sent Events stream of function execution chunks