> ## 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

> Sends the chat history and the current editor state to the indicator assistant and returns its answer. When the answer contains a script, `source` is the complete Hyperprop Script to put in the editor (declarations plus `compute`), with `pane` and `name` set when the assistant wants them changed. Pass `error` to have a failing script fixed. Requests are limited to 40 per trader per hour; the response is typically 5–30 seconds because the whole script is generated in one pass. Timeout after 120 seconds.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/indicator-builder/chat
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:
    post:
      tags:
        - Indicator Builder
      summary: Ask the indicator assistant
      description: >-
        Sends the chat history and the current editor state to the indicator
        assistant and returns its answer. When the answer contains a script,
        `source` is the complete Hyperprop Script to put in the editor
        (declarations plus `compute`), with `pane` and `name` set when the
        assistant wants them changed. Pass `error` to have a failing script
        fixed. Requests are limited to 40 per trader per hour; the response is
        typically 5–30 seconds because the whole script is generated in one
        pass. Timeout after 120 seconds.
      operationId: postV1IndicatorbuilderChat
      requestBody:
        $ref: '#/components/requestBodies/Model470'
      responses:
        '200':
          description: Assistant reply
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model472'
        '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/Model474'
        '502':
          description: The indicator assistant returned an error.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model475'
        '503':
          description: The indicator assistant is not configured on this server.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model476'
        '504':
          description: >-
            The indicator assistant took too long to answer. Try a simpler
            request.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model477'
components:
  requestBodies:
    Model470:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Model470'
  schemas:
    Model472:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/Model471'
    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
    Model474:
      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
    Model475:
      type: object
      properties:
        success:
          type: boolean
          description: Always false on errors
          example: false
        statusCode:
          type: number
          example: 502
        error:
          type: string
          example: Error
        message:
          type: string
          example: The indicator assistant returned an error.
        code:
          type: string
          description: Machine-readable error code — switch on this, not on message text
          example: MODEL_ERROR
    Model476:
      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
    Model477:
      type: object
      properties:
        success:
          type: boolean
          description: Always false on errors
          example: false
        statusCode:
          type: number
          example: 504
        error:
          type: string
          example: Error
        message:
          type: string
          example: >-
            The indicator assistant took too long to answer. Try a simpler
            request.
        code:
          type: string
          description: Machine-readable error code — switch on this, not on message text
          example: MODEL_TIMEOUT
    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
    Model471:
      type: object
      properties:
        message:
          type: string
          description: Assistant prose for the chat panel. The code block has been removed.
          example: A 14-period RSI in its own pane with 30/70 guides.
        source:
          type: string
          description: Complete replacement script, or null when the answer needed no code.
          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] };
            }
        pane:
          $ref: '#/components/schemas/pane'
        name:
          type: string
          example: RSI
    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
    pane:
      type: string
      example: separate
      enum:
        - overlay
        - separate
    Model469:
      type: object
      properties:
        role:
          $ref: '#/components/schemas/Model468'
        content:
          type: string
          minLength: 1
          maxLength: 24000
      required:
        - role
        - content
    Model468:
      type: string
      enum:
        - user
        - assistant

````

## Related topics

- [Ask the indicator assistant (streaming)](/platform-api/indicator-builder/ask-the-indicator-assistant-streaming.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)
