> ## Documentation Index
> Fetch the complete documentation index at: https://platform.autumn.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Execute and stream

> Tell the sandboxed task to produce output and stream live server-sent events for the current turn.



## OpenAPI

````yaml /openapi.json post /task/{task_id}/execute/stream
openapi: 3.1.0
info:
  title: Autumn Task API
  version: 1.0.0
  description: >-
    Start, stream, continue, execute, return to plan, and read sandboxed Autumn
    tasks. The public API surface is /task.
servers:
  - url: https://api.autumn.ai
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: POST
    x-group: POST
  - name: GET
    x-group: GET
paths:
  /task/{task_id}/execute/stream:
    post:
      tags:
        - POST
      summary: Execute and stream
      description: >-
        Tell the sandboxed task to produce output and stream live server-sent
        events for the current turn.
      operationId: taskExecuteStream
      parameters:
        - $ref: '#/components/parameters/TaskId'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteRequest'
            example: {}
      responses:
        '200':
          description: SSE stream of task, tool, text, error, and done events.
          content:
            text/event-stream:
              schema:
                type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/OutOfCredits'
components:
  parameters:
    TaskId:
      name: task_id
      in: path
      description: The task_id returned by `POST /task` or `POST /task/start`.
      required: true
      schema:
        type: string
        example: 8fab6f34
  schemas:
    ExecuteRequest:
      type: object
      properties:
        message:
          type: string
          nullable: true
          description: Optional instruction to include with execution.
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        detail:
          type: string
      additionalProperties: true
  responses:
    BadRequest:
      description: The request body was invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    OutOfCredits:
      description: The account is out of credits.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Autumn API key
      description: 'Use `Authorization: Bearer YOUR_AUTUMN_API_KEY`.'
      x-default: YOUR_AUTUMN_API_KEY
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Alternate API-key header. Use the same Autumn API key.
      x-default: YOUR_AUTUMN_API_KEY

````