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

> ## Agent Instructions
> Autumn AI (autumn.ai) is a people and company intelligence API, a separate company from useautumn.com (billing software); no billing-product routes exist here.
> Base URL https://api.autumn.ai. Auth on every request: `X-API-Key: <key>` or `Authorization: Bearer <key>`. Plain HTTP + JSON. Schemas: https://www.autumn.ai/docs/openapi.json. Every docs page is Markdown at its URL plus `.md`.

# Execute a task and stream

> Produce output and stream the turn.



## OpenAPI

````yaml https://api.autumn.ai/openapi.json post /task/{task_id}/execute/stream
openapi: 3.1.0
info:
  title: Autumn Task API
  description: >-
    Durable research tasks run by a sandboxed agent. Auth on every request:
    `X-API-Key: <key>` or `Authorization: Bearer <key>`. JSON over HTTP;
    `/stream` routes are server-sent events. Errors share one body: branch on
    `error`, retry when `retryable` is true.
  termsOfService: https://www.autumn.ai/terms
  contact:
    name: Autumn
    url: https://www.autumn.ai/
  version: 1.0.0
  x-llms-txt: https://api.autumn.ai/llms.txt
servers:
  - url: https://api.autumn.ai
security:
  - ApiKeyHeader: []
  - BearerApiKey: []
tags:
  - name: Tasks
    description: Start, continue, execute, stop and read tasks.
  - name: Outputs
    description: Rows a task produced.
  - name: Credits
    description: Account balance.
  - name: Uploads
    description: Attach a CSV or text file to a task.
externalDocs:
  description: Guide and cookbook
  url: https://www.autumn.ai/docs
paths:
  /task/{task_id}/execute/stream:
    post:
      tags:
        - Tasks
      summary: Execute a task and stream
      description: Produce output and stream the turn.
      operationId: taskExecuteStream
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            description: The task_id returned by POST /task or POST /task/start.
            examples:
              - 8fab6f34
            title: Task Id
          description: The task_id returned by POST /task or POST /task/start.
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/ExecuteRequest'
                - type: 'null'
              title: Body
      responses:
        '200':
          description: >-
            Server-sent events: task, tool, text, error, done. A failure after
            the stream opens is an error event.
          content:
            text/event-stream:
              schema:
                type: string
        '400':
          description: >-
            `invalid_request`: The request is invalid. Fix the field in `param`
            (see `detail`), or read `message`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_request:
                  summary: invalid_request
                  value:
                    error: invalid_request
                    message: >-
                      The request is invalid. Fix the field in `param` (see
                      `detail`), or read `message`.
                    retryable: false
                    request_id: req_3f9c2a1b0d4e5f6a7b8c
        '401':
          description: >-
            `unauthorized`: Missing or invalid credentials. Send your full API
            key as `X-API-Key: <key>` or `Authorization: Bearer <key>`.
          headers:
            WWW-Authenticate:
              description: Bearer realm="autumn"
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  summary: unauthorized
                  value:
                    error: unauthorized
                    message: >-
                      Missing or invalid credentials. Send your full API key as
                      `X-API-Key: <key>` or `Authorization: Bearer <key>`.
                    retryable: false
                    request_id: req_3f9c2a1b0d4e5f6a7b8c
        '422':
          description: >-
            `invalid_request`: a field failed validation. `param` names it;
            `detail` is the validator output.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: invalid_request
                message: 'prompt: Field required'
                retryable: false
                param: prompt
                detail:
                  - type: missing
                    loc:
                      - body
                      - prompt
                    msg: Field required
                request_id: req_3f9c2a1b0d4e5f6a7b8c
        '503':
          description: >-
            `auth_unavailable`: Key verification is temporarily unavailable.
            Wait `retry_after` seconds, then send the request again.
          headers:
            Retry-After:
              description: Seconds to wait before the next request.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                auth_unavailable:
                  summary: auth_unavailable
                  value:
                    error: auth_unavailable
                    message: >-
                      Key verification is temporarily unavailable. Wait
                      `retry_after` seconds, then send the request again.
                    retryable: true
                    request_id: req_3f9c2a1b0d4e5f6a7b8c
                    retry_after: 5
      security:
        - ApiKeyHeader: []
        - BearerApiKey: []
components:
  schemas:
    ExecuteRequest:
      properties:
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: Instruction to include with the execution.
        input_files:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Input Files
          description: Task-local filenames returned by POST /validate-upload.
        wait:
          type: boolean
          title: Wait
          description: >-
            Wait for the turn to finish (200). Default false: queue and return
            (202).
          default: false
      additionalProperties: true
      type: object
      title: ExecuteRequest
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: Stable snake_case code. Branch on this field.
          examples:
            - out_of_credits
        message:
          type: string
          title: Message
          description: What went wrong and what to do next.
        retryable:
          type: boolean
          title: Retryable
          description: >-
            True: the same request can succeed later. False: change the request,
            key, balance or id first.
        request_id:
          type: string
          title: Request Id
          description: Also the X-Request-ID header. A client-sent X-Request-ID is echoed.
          examples:
            - req_3f9c2a1b0d4e5f6a7b8c
        retry_after:
          anyOf:
            - type: integer
            - type: 'null'
          title: Retry After
          description: Seconds to wait. Mirrors the Retry-After header. On 429.
        resolve:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolve
          description: Where to fix the cause. On 402.
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
          description: The field that failed validation. On 422.
        detail:
          anyOf:
            - {}
            - type: 'null'
          title: Detail
          description: Full validator output. On 422.
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
          description: The task the error refers to.
        task_created:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Task Created
          description: False when task creation was refused, so no task exists.
      additionalProperties: true
      type: object
      required:
        - error
        - message
        - retryable
        - request_id
      title: ErrorResponse
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your Autumn API key.
      x-default: YOUR_AUTUMN_API_KEY
    BearerApiKey:
      type: http
      scheme: bearer
      bearerFormat: Autumn API key
      description: 'The same key as `Authorization: Bearer <key>`.'
      x-default: YOUR_AUTUMN_API_KEY

````