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

# Agent Metrics



## OpenAPI

````yaml /openapi.json get /api/v1/agents/{agent_id}/metrics
openapi: 3.1.0
info:
  title: SeaOtter API
  description: >-
    SeaOtter control plane API — managed Hermes Agent hosting. Authenticate with
    a Clerk session JWT (web) or an org-scoped API key (`Authorization: Bearer
    so_…` from POST /api/v1/api-keys). Public developer docs:
    https://docs.seaotter.dev
  version: 1.0.0
servers:
  - url: https://api.seaotter.dev
    description: Production
  - url: https://seaotter-api-bpenevambq-uc.a.run.app
    description: Production (Cloud Run URL)
  - url: http://localhost:8000
    description: Local development
security: []
tags:
  - name: agents
    description: Provision and operate Hermes agents
  - name: billing
    description: Stripe plans and subscriptions
  - name: users
    description: Current user and control-plane API keys
  - name: organizations
    description: Active organization context
  - name: audit
    description: Organization audit log (Enterprise)
  - name: health
    description: Liveness probes
paths:
  /api/v1/agents/{agent_id}/metrics:
    get:
      tags:
        - agents
      summary: Agent Metrics
      operationId: agent_metrics_api_v1_agents__agent_id__metrics_get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Agent Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentMetricsOut'
        '401':
          description: Missing or invalid Bearer token (Clerk JWT or so_ API key)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '403':
          description: Authenticated but not permitted (role or plan gate)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    AgentMetricsOut:
      properties:
        cpu_pct:
          anyOf:
            - type: number
            - type: 'null'
          title: Cpu Pct
          description: CPU vs plan limit (%)
        mem_pct:
          anyOf:
            - type: number
            - type: 'null'
          title: Mem Pct
          description: Memory vs plan limit (%)
        restarts_24h:
          anyOf:
            - type: integer
            - type: 'null'
          title: Restarts 24H
        pvc_pct:
          anyOf:
            - type: number
            - type: 'null'
          title: Pvc Pct
          description: PVC usage vs plan storage (%)
        uptime_pct_24h:
          anyOf:
            - type: number
            - type: 'null'
          title: Uptime Pct 24H
        latency_p95_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Latency P95 Ms
          description: Null until Managed Prometheus scrapes with Host match
        cpu_cores:
          anyOf:
            - type: number
            - type: 'null'
          title: Cpu Cores
        memory_bytes:
          anyOf:
            - type: number
            - type: 'null'
          title: Memory Bytes
        series:
          anyOf:
            - $ref: '#/components/schemas/MetricsSeries'
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Series
      additionalProperties: true
      type: object
      title: AgentMetricsOut
    ErrorBody:
      properties:
        detail:
          anyOf:
            - type: string
            - items: {}
              type: array
          title: Detail
          description: Human-readable error, or validation error list
          examples:
            - Agent not found
      type: object
      required:
        - detail
      title: ErrorBody
      description: Standard FastAPI / SeaOtter error payload.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MetricsSeries:
      properties:
        cpu:
          items:
            $ref: '#/components/schemas/MetricPoint'
          type: array
          title: Cpu
        memory:
          items:
            $ref: '#/components/schemas/MetricPoint'
          type: array
          title: Memory
        requests:
          items:
            $ref: '#/components/schemas/MetricPoint'
          type: array
          title: Requests
        errors:
          items:
            $ref: '#/components/schemas/MetricPoint'
          type: array
          title: Errors
      additionalProperties: true
      type: object
      title: MetricsSeries
    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
    MetricPoint:
      properties:
        t:
          anyOf:
            - type: number
            - type: integer
          title: T
          description: Unix timestamp or series index
        v:
          type: number
          title: V
          description: Sample value
      type: object
      required:
        - t
        - v
      title: MetricPoint
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT or so_ API key
      description: >-
        Clerk session JWT for the web app, or a control-plane API key (`so_…`)
        from POST /api/v1/api-keys for programmatic / docs try-it use.

````