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

# Ask the indicator assistant (streaming)

> Same request as `POST /v1/indicator-builder/chat`, but the answer is streamed as newline-delimited JSON (`application/x-ndjson`) so the client can show the reply as it is written. Events: `{"type":"thinking"}` heartbeats while the model reasons, `{"type":"delta","text":"…"}` for each piece of answer text (prose and the code block, in order), and exactly one terminal event — `{"type":"done","data":{message,source,pane,name}}` with the same shape as the non-streaming response, or `{"type":"error","code","message"}`. The HTTP status is 200 once streaming has begun; rate-limit and configuration errors are returned as normal JSON errors before any bytes are sent. Prefer this endpoint: long scripts can take over a minute to generate.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/indicator-builder/chat/stream
openapi: 3.0.0
info:
  title: Hyperprop Platform API
  version: 1.0.0
  description: >-
    REST API for the Hyperprop Trading Platform — provision evaluation and
    funded trading accounts, manage traders and plans, react to account
    lifecycle events via signed webhooks, and reconcile billing. Built for prop
    firms integrating from their own backend.


    Authentication, quick start, error handling, idempotency, pagination, custom
    metadata, webhooks, and the MCP connector are documented at
    https://docs.hyperprop.com.
  x-logo:
    url: https://app.hyperprop.com/logo-icon.svg
    altText: Hyperprop
    href: https://hyperprop.com
servers:
  - url: https://api.hyperprop.com/platform
    description: Production
security: []
tags:
  - name: Authentication
    description: >-
      User authentication - signup, signin, signout, password reset, email
      verification, OAuth, and MFA
  - name: User
    description: >-
      User account management - profile, notifications, agreements, dismissals,
      and audit logs. Requires Bearer token.
  - name: Organization
    description: >-
      Organization management - profile, team, trading accounts, plans, and
      rules. Supports **dual authentication**: Bearer JWT token (dashboard
      users) OR X-API-Key (programmatic access).
  - name: Market Data
    description: CME futures contracts and market data. Requires Bearer token.
  - name: Indicator Builder
    description: >-
      AI-assisted authoring of custom Hyperprop Script indicators for the web
      terminal. Requires Bearer token.
  - name: System
    description: System endpoints - health checks and connectivity
paths:
  /v1/indicator-builder/chat/stream:
    post:
      tags:
        - Indicator Builder
      summary: Ask the indicator assistant (streaming)
      description: >-
        Same request as `POST /v1/indicator-builder/chat`, but the answer is
        streamed as newline-delimited JSON (`application/x-ndjson`) so the
        client can show the reply as it is written. Events:
        `{"type":"thinking"}` heartbeats while the model reasons,
        `{"type":"delta","text":"…"}` for each piece of answer text (prose and
        the code block, in order), and exactly one terminal event —
        `{"type":"done","data":{message,source,pane,name}}` with the same shape
        as the non-streaming response, or `{"type":"error","code","message"}`.
        The HTTP status is 200 once streaming has begun; rate-limit and
        configuration errors are returned as normal JSON errors before any bytes
        are sent. Prefer this endpoint: long scripts can take over a minute to
        generate.
      operationId: postV1IndicatorbuilderChatStream
      requestBody:
        $ref: '#/components/requestBodies/Model470'
      responses:
        '200':
          description: NDJSON event stream (see notes)
          content:
            '*/*':
              schema:
                type: string
        '400':
          description: Validation failed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model473'
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model9'
        '429':
          description: >-
            You have reached the indicator builder limit for this hour. Try
            again later.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model595'
        '503':
          description: The indicator assistant is not configured on this server.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model596'
components:
  requestBodies:
    Model470:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Model470'
  schemas:
    Model473:
      type: object
      properties:
        success:
          type: boolean
          description: Always false on errors
          example: false
        statusCode:
          type: number
          example: 400
        error:
          type: string
          example: Bad Request
        message:
          type: string
          example: Validation failed
        code:
          type: string
          description: Machine-readable error code — switch on this, not on message text
          example: VALIDATION_ERROR
    Model9:
      type: object
      properties:
        success:
          type: boolean
          description: Always false on errors
          example: false
        statusCode:
          type: number
          example: 401
        error:
          type: string
          example: Unauthorized
        message:
          type: string
          example: Authentication required
        code:
          type: string
          description: Machine-readable error code — switch on this, not on message text
          example: UNAUTHORIZED
    Model595:
      type: object
      properties:
        success:
          type: boolean
          description: Always false on errors
          example: false
        statusCode:
          type: number
          example: 429
        error:
          type: string
          example: Too Many Requests
        message:
          type: string
          example: >-
            You have reached the indicator builder limit for this hour. Try
            again later.
        code:
          type: string
          description: Machine-readable error code — switch on this, not on message text
          example: RATE_LIMITED
    Model596:
      type: object
      properties:
        success:
          type: boolean
          description: Always false on errors
          example: false
        statusCode:
          type: number
          example: 503
        error:
          type: string
          example: Error
        message:
          type: string
          example: The indicator assistant is not configured on this server.
        code:
          type: string
          description: Machine-readable error code — switch on this, not on message text
          example: MODEL_UNAVAILABLE
    Model470:
      type: object
      properties:
        messages:
          $ref: '#/components/schemas/messages'
        script:
          $ref: '#/components/schemas/script'
        error:
          type: string
          description: >-
            Compile or runtime error the chart reported for the current script,
            if any.
          example: null
          maxLength: 2000
        dataset:
          $ref: '#/components/schemas/dataset'
      required:
        - messages
        - script
    messages:
      type: array
      description: >-
        Chat history, oldest first. The last message must be from the user. Each
        message is capped at 24,000 characters — enough for a full Pine Script
        paste.
      example:
        - role: user
          content: Build an RSI with 30/70 guides.
      minItems: 1
      maxItems: 40
      items:
        $ref: '#/components/schemas/Model469'
    script:
      type: object
      description: >-
        What is currently in the editor. The reply replaces it wholesale when it
        contains code.
      properties:
        name:
          type: string
          example: RSI
          default: ''
          maxLength: 80
        pane:
          $ref: '#/components/schemas/pane'
        source:
          type: string
          example: |-
            const length = input.int('Length', 14, { min: 2, max: 100 });
            function compute(bars, inputs, hp) {
              const rsi = hp.rsi(bars.map(b => b.c), length);
              return { plots: [{ title: 'RSI', values: rsi, color: '#ab47bc' }], range: { min: 0, max: 100 }, guides: [30, 70] };
            }
          maxLength: 40000
      required:
        - pane
        - source
    dataset:
      type: object
      description: >-
        The sample series the builder chart is showing, so the model can reason
        about scale and bar count.
      properties:
        symbol:
          type: string
          example: ES
          maxLength: 16
        interval:
          type: string
          example: 5m
          maxLength: 8
        barCount:
          type: integer
          example: 3000
          minimum: 0
          maximum: 100000
      required:
        - symbol
        - interval
        - barCount
    Model469:
      type: object
      properties:
        role:
          $ref: '#/components/schemas/Model468'
        content:
          type: string
          minLength: 1
          maxLength: 24000
      required:
        - role
        - content
    pane:
      type: string
      example: separate
      enum:
        - overlay
        - separate
    Model468:
      type: string
      enum:
        - user
        - assistant

````

## Related topics

- [Ask the indicator assistant](/platform-api/indicator-builder/ask-the-indicator-assistant.md)
- [Indicator assistant availability](/platform-api/indicator-builder/indicator-assistant-availability.md)
- [Hyperprop Script: build indicators (agent recipe)](/guides/hyperprop-script.md)
- [Changelog](/changelog.md)
- [Get all order books (best bid/ask)](/market-data-api/order-book/get-all-order-books-best-bidask.md)
