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

# Table Schema



## OpenAPI

````yaml openapi.json GET /gateway/v1/onchain/schema
openapi: 3.1.0
info:
  title: Hermod
  version: 0.0.1
servers:
  - url: https://api.asksurf.ai
security: []
paths:
  /gateway/v1/onchain/schema:
    get:
      tags:
        - Onchain
      summary: On-Chain Table Schema
      description: >-
        Returns table metadata for all available on-chain databases.


        **Included fields:** database name, table name, column names, types, and
        comments.
      operationId: onchain-schema
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataResponseOnchainSchemaTable'
          description: OK
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataAPIError'
          description: Error
      security:
        - AccessToken: []
components:
  schemas:
    DataResponseOnchainSchemaTable:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://example.com/schemas/DataResponseOnchainSchemaTable.json
          format: uri
          readOnly: true
          type: string
        data:
          items:
            $ref: '#/components/schemas/OnchainSchemaTable'
          type:
            - array
            - 'null'
        meta:
          $ref: '#/components/schemas/OffsetMeta'
      required:
        - data
        - meta
      type: object
    DataAPIError:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://example.com/schemas/DataAPIError.json
          format: uri
          readOnly: true
          type: string
        error:
          $ref: '#/components/schemas/DataAPIErrorDetail'
      required:
        - error
      type: object
    OnchainSchemaTable:
      additionalProperties: false
      properties:
        columns:
          description: List of columns in this table
          items:
            $ref: '#/components/schemas/OnchainSchemaCol'
          type:
            - array
            - 'null'
        database:
          description: Database name (always `agent`)
          type: string
        table:
          description: Table name
          type: string
      required:
        - database
        - table
        - columns
      type: object
    OffsetMeta:
      additionalProperties: false
      properties:
        cached:
          description: Whether this response was served from cache
          type: boolean
        credits_used:
          description: Credits deducted for this request
          format: int64
          type: integer
        limit:
          description: Maximum number of items returned in this response
          format: int64
          type: integer
        offset:
          description: Number of items skipped (pagination offset)
          format: int64
          type: integer
        total:
          description: >-
            Total number of matching items (before pagination). Omitted when
            total is unknown.
          format: int64
          type: integer
      required:
        - limit
        - offset
        - credits_used
        - cached
      type: object
    DataAPIErrorDetail:
      additionalProperties: false
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
    OnchainSchemaCol:
      additionalProperties: false
      properties:
        comment:
          description: Column comment or description
          type: string
        name:
          description: Column name
          type: string
        type:
          description: Column data type like `UInt64`, `String`, or `DateTime`
          type: string
      required:
        - name
        - type
      type: object

````