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

# Start an analysis

> Queue an analysis and return immediately with **202 Accepted**.

The response is a job reference, not a result — poll `poll` until `status`
leaves `queued`/`running`.



## OpenAPI

````yaml /api/openapi.json post /v1/analyses
openapi: 3.1.0
info:
  title: BlackQuant TradingAgents API
  description: >

    An HTTP API over the
    [TradingAgents](https://github.com/TauricResearch/TradingAgents)

    multi-agent LLM trading framework by Tauric Research, used under Apache-2.0.


    ## Analyses are asynchronous


    A single analysis runs a full multi-agent debate and takes **minutes**, not

    seconds. `POST /v1/analyses` therefore returns a job reference immediately
    and

    the result is collected by polling `GET /v1/analyses/{id}`.


    ## Ratings


    A completed analysis carries one of `Buy`, `Overweight`, `Hold`,
    `Underweight`,

    `Sell` — or `REVIEW`.


    `REVIEW` is **not** a weak Hold. It means the run produced no parseable
    rating,

    so there is no opinion to act on. Check `is_review` before reading `rating`.


    ## This API places no orders


    Nothing here can move money. It starts analyses and returns what they
    decided.
  version: 0.1.0
servers:
  - url: http://127.0.0.1:8900
    description: Local
security: []
tags:
  - name: Analyses
    description: Start, poll and cancel analyses.
  - name: Service
    description: Health and effective configuration.
paths:
  /v1/analyses:
    post:
      tags:
        - Analyses
      summary: Start an analysis
      description: >-
        Queue an analysis and return immediately with **202 Accepted**.


        The response is a job reference, not a result — poll `poll` until
        `status`

        leaves `queued`/`running`.
      operationId: create_analysis_v1_analyses_post
      parameters:
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnalysisRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobRef'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unauthorized
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Service Unavailable
components:
  schemas:
    AnalysisRequest:
      properties:
        ticker:
          type: string
          maxLength: 32
          minLength: 1
          title: Ticker
          description: Instrument symbol, e.g. `NVDA` or `BTC`.
          examples:
            - NVDA
        trade_date:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
          title: Trade Date
          description: >-
            The as-of date, `YYYY-MM-DD`. The graph reasons as though standing
            on this date, so a future one yields nothing useful.
          examples:
            - '2024-05-10'
        asset_type:
          $ref: '#/components/schemas/AssetType'
          description: Selects the stock or crypto pipeline.
          default: stock
        analysts:
          items:
            $ref: '#/components/schemas/Analyst'
          type: array
          minItems: 1
          title: Analysts
          description: >-
            Analyst agents to include. Fewer analysts is cheaper and faster, and
            narrows what the debate can consider.
        max_debate_rounds:
          anyOf:
            - type: integer
              maximum: 10
              minimum: 1
            - type: 'null'
          title: Max Debate Rounds
          description: >-
            Overrides `TRADINGAGENTS_MAX_DEBATE_ROUNDS` for this run. Cost
            scales roughly linearly with it.
      type: object
      required:
        - ticker
        - trade_date
      title: AnalysisRequest
    JobRef:
      properties:
        id:
          type: string
          title: Id
        status:
          $ref: '#/components/schemas/JobStatus'
        poll:
          type: string
          title: Poll
          description: URL to poll for completion.
      type: object
      required:
        - id
        - status
        - poll
      title: JobRef
      description: What creating an analysis returns — the run itself is asynchronous.
    Error:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: Error
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AssetType:
      type: string
      enum:
        - stock
        - crypto
      title: AssetType
      description: Which pipeline the graph runs. The CLI infers this; callers state it.
    Analyst:
      type: string
      enum:
        - market
        - social
        - news
        - fundamentals
      title: Analyst
      description: The analyst agents available to a run.
    JobStatus:
      type: string
      enum:
        - queued
        - running
        - succeeded
        - failed
        - cancelled
      title: JobStatus
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````