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

# AI Analyze

> Submit a natural-language prompt for AI-powered financial analysis. Supports streaming via Server-Sent Events.



## OpenAPI

````yaml POST /vq/ai/analyze
openapi: 3.1.0
info:
  title: VecTrade API
  version: 1.0.0
  description: |
    Financial data, AI-powered analysis, and trading intelligence.

    ## Authentication
    All requests require an API key in the `X-API-Key` header:
    ```
    X-API-Key: vq_your_key_here
    ```

    ## Rate Limits
    Response headers include rate limit info:
    - `X-VQ-RateLimit-Limit` — requests per window
    - `X-VQ-RateLimit-Remaining` — remaining requests
    - `X-VQ-RateLimit-Reset` — window reset timestamp (Unix)
  contact:
    name: VecTrade API Support
    email: api@vectrade.io
    url: https://docs.vectrade.io
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
  - url: https://api.vectrade.io/v1
    description: Production & Sandbox (mode determined by API key prefix)
security:
  - ApiKeyAuth: []
paths:
  /vq/ai/analyze:
    post:
      tags:
        - AI
      summary: AI-powered financial analysis
      description: >-
        Submit a natural-language prompt for AI-powered financial analysis.
        Supports streaming via Server-Sent Events.
      operationId: analyzeAI
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - prompt
              properties:
                prompt:
                  type: string
                  description: Analysis prompt
                  example: Analyze AAPL for long-term hold
                symbols:
                  type: array
                  items:
                    type: string
                  description: Symbols to include in context
                stream:
                  type: boolean
                  default: false
      responses:
        '200':
          description: Analysis response (or SSE stream if stream=true)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIResponse'
            text/event-stream:
              schema:
                type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    AIResponse:
      type: object
      properties:
        content:
          type: string
        citations:
          type: array
          items:
            type: object
            properties:
              source:
                type: string
              url:
                type: string
        usage:
          type: object
          properties:
            promptTokens:
              type: integer
            completionTokens:
              type: integer
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
            type:
              type: string
            docs_url:
              type: string
        request_id:
          type: string
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limit exceeded
      headers:
        Retry-After:
          schema:
            type: number
        X-VQ-RateLimit-Limit:
          schema:
            type: integer
        X-VQ-RateLimit-Remaining:
          schema:
            type: integer
        X-VQ-RateLimit-Reset:
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: VecTrade API key (e.g., vq_live_...)

````