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

# Chat with The Brain

> Send a natural language query to The Brain. It routes to the right specialist(s) automatically. Add "Respond as JSON with:" to your message and specify fields to get structured JSON back.



## OpenAPI

````yaml /openapi.json post /v1/chat
openapi: 3.1.0
info:
  title: Gigabrain API
  description: Programmatic access to The Brain and Gigabrain Agents.
  version: 1.0.0
servers:
  - url: https://api.gigabrain.gg
security:
  - bearerAuth: []
tags:
  - name: Brain
    description: Query The Brain for real-time crypto market intelligence
  - name: Agents
    description: Create and manage autonomous trading agents
  - name: Wallet
    description: Manage agent trading wallets on Hyperliquid
  - name: Agent Chat & Monitoring
    description: Chat with agents and monitor execution history
  - name: SuperAgents
    description: Launch, list, get, and destroy SuperAgents
  - name: SuperAgent Lifecycle
    description: Pause, resume, and restart SuperAgents
  - name: SuperAgent Chat
    description: Chat with SuperAgents
  - name: SuperAgent Monitoring
    description: Health checks, files, and skills
  - name: SuperAgent Config
    description: Update soul, model, profile, and skills configuration
  - name: SuperAgent Wallet
    description: View SuperAgent wallet details
paths:
  /v1/chat:
    post:
      tags:
        - Brain
      summary: Chat with The Brain
      description: >-
        Send a natural language query to The Brain. It routes to the right
        specialist(s) automatically. Add "Respond as JSON with:" to your message
        and specify fields to get structured JSON back.
      operationId: chat
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatRequest'
            examples:
              trade_setup:
                summary: Get a trade setup
                value:
                  message: >-
                    Should I long or short ETH right now? Check technicals,
                    funding, and macro. Respond as JSON with: direction,
                    entry_price, stop_loss, take_profit_1, take_profit_2,
                    risk_reward_ratio, confidence, reasoning
              squeeze_scan:
                summary: Find squeeze setups
                value:
                  message: >-
                    Find tokens with extreme funding rates and crowded
                    positioning that could squeeze. Respond as JSON array with:
                    symbol, funding_rate, open_interest, long_short_ratio,
                    squeeze_direction, liquidation_risk
              macro_check:
                summary: Macro risk screen
                value:
                  message: >-
                    What's the current macro risk regime for crypto? Factor in
                    DXY, yields, VIX, and equities. Respond as JSON with:
                    risk_regime, dxy_trend, vix_level, recommended_exposure,
                    reasoning
      responses:
        '200':
          description: Analysis complete
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '504':
          description: Query timeout. Break into smaller, more specific requests.
components:
  schemas:
    ChatRequest:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: >-
            Your query to The Brain. Add "Respond as JSON with:" and list fields
            for structured output.
        stream:
          type: boolean
          default: false
          description: Enable streaming response
        model:
          type: string
          description: >-
            Model ID from the provider's API. Use the exact ID the provider uses
            — e.g. "gpt-4o" for OpenAI, "claude-sonnet-4-20250514" for
            Anthropic, "anthropic/claude-sonnet-4" for OpenRouter. Requires a
            connected API key for the chosen provider.
        model_provider:
          type: string
          enum:
            - openai
            - anthropic
            - xai
            - openrouter
            - venice
          description: >-
            Provider of the custom model. Must match the provider you connected
            your API key for.
    ChatResponse:
      type: object
      properties:
        session_id:
          type: string
          format: uuid
        content:
          type: string
          description: >-
            The response. Contains markdown by default, or parseable JSON if you
            requested it.
        timestamp:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
  responses:
    Unauthorized:
      description: Invalid or revoked API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 401
            message: Invalid or revoked API key
    RateLimited:
      description: Rate limit exceeded (60 requests per minute)
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: integer
                example: 429
              message:
                type: string
                example: Rate limit exceeded
              retryAfter:
                type: integer
                description: Seconds to wait before retrying
                example: 45
              resetAt:
                type: string
                format: date-time
      headers:
        Retry-After:
          description: Seconds to wait before retrying
          schema:
            type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your Gigabrain API key. Get one at https://gigabrain.gg/profile?tab=api.
        Format: `gb_sk_...`

````