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

# Run the Compute agent

> Runs Messari's Compute agent standalone over Messari's quantitative datasets. Returns each executed SQL query in `results`, with `query_result` rows, the `columns` naming each row position, and `truncated` reporting that the row cap was reached. `error` carries the agent's explanation when a run produces no usable result. There is no synthesized answer: this endpoint computes, and the caller writes the answer. The SQL and column names reflect Messari's internal schema, which may change without notice: read them, do not parse them. Requires an authenticated Enterprise user holding the `ai_toolkit_permission` API permission. Limited to 30 requests per minute per user.



## OpenAPI

````yaml POST /ai/v1/agent/compute
openapi: 3.0.0
info:
  description: OpenAPI specification for the entire Messari API
  title: Messari API - Ai V1
  version: 1.0.0
servers:
  - description: Messari API
    url: https://api.messari.io
security: []
paths:
  /ai/v1/agent/compute:
    post:
      summary: Run the Compute agent
      description: >-
        Runs Messari's Compute agent standalone over Messari's quantitative
        datasets. Returns each executed SQL query in `results`, with
        `query_result` rows, the `columns` naming each row position, and
        `truncated` reporting that the row cap was reached. `error` carries the
        agent's explanation when a run produces no usable result. There is no
        synthesized answer: this endpoint computes, and the caller writes the
        answer. The SQL and column names reflect Messari's internal schema,
        which may change without notice: read them, do not parse them. Requires
        an authenticated Enterprise user holding the `ai_toolkit_permission` API
        permission. Limited to 30 requests per minute per user.
      operationId: postComputeAgent
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ComputeRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/ComputeResponse'
                  error:
                    type: string
                  metadata:
                    $ref: '#/components/schemas/ComputeResponseMetadata'
                required:
                  - data
                type: object
              example:
                error: null
                data:
                  results:
                    - dataset: asset
                      query: >-
                        SELECT asset.name, asset.symbol,
                        asset.circulating_marketcap_usd, asset.latest_price_time
                        FROM asset WHERE asset.asset_id =
                        '1e31218a-e44e-4285-820c-8282ee222035' LIMIT 1;
                      columns:
                        - NAME
                        - SYMBOL
                        - CIRCULATING_MARKETCAP_USD
                        - LATEST_PRICE_TIME
                      query_result: '[["Bitcoin","BTC","1285476589284","2026-08-17"]]'
                metadata:
                  trace_id: 9e741d30-e05a-496d-a409-f87856aef133
          description: Default response
        '400':
          content:
            application/json:
              schema:
                properties:
                  data: {}
                  error:
                    type: string
                required:
                  - data
                type: object
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                properties:
                  data: {}
                  error:
                    type: string
                required:
                  - data
                type: object
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                properties:
                  data: {}
                  error:
                    type: string
                required:
                  - data
                type: object
          description: Forbidden
        '429':
          content:
            application/json:
              schema:
                properties:
                  data: {}
                  error:
                    type: string
                required:
                  - data
                type: object
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                properties:
                  data: {}
                  error:
                    type: string
                required:
                  - data
                type: object
          description: Internal Server Error
      security:
        - apiKey: []
components:
  schemas:
    ComputeRequest:
      properties:
        query:
          description: >-
            One natural language question naming the metric, the entity, and the
            time range.
          type: string
          example: What is the market cap of Bitcoin?
      required:
        - query
      type: object
    ComputeResponse:
      properties:
        results:
          description: The queries that ran.
          items:
            $ref: '#/components/schemas/ComputeResult'
          type: array
        error:
          description: Set only when the run produces no usable result. It explains why.
          type: string
      required:
        - results
      type: object
    ComputeResponseMetadata:
      properties:
        trace_id:
          format: byte
          type: string
      required:
        - trace_id
      type: object
    ComputeResult:
      properties:
        dataset:
          description: The dataset the query ran against.
          type: string
        query:
          description: The SQL the agent executed.
          type: string
        columns:
          description: >-
            Names the positions in each query_result row, which are otherwise
            unlabelled.
          items:
            type: string
          type: array
        query_result:
          description: The rows, JSON-encoded as an array of arrays.
          type: string
        truncated:
          description: The row cap was reached, so more rows may match.
          type: boolean
        query_error:
          description: Why this query returned nothing.
          type: string
      type: object
  securitySchemes:
    apiKey:
      in: header
      name: X-Messari-API-Key
      type: apiKey

````