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

# Report trader status

> A trader container reports liveness and headline numbers. Upserts one record per `instanceId`. Free.



## OpenAPI

````yaml /openapi.json post /api/v1/trader/heartbeat
openapi: 3.0.3
info:
  title: Chance API
  version: 1.0.0
  description: >-
    Verify an agent's proposed action against its rules, manage escrow wallets,
    and buy credits. Every verification returns a signed, hash-chained receipt.
servers:
  - url: https://harness.chance.cc
    description: Production
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Verification
    description: Check an action against its rules and fetch past verdicts.
  - name: Credits
    description: Balance and x402 top-ups.
  - name: Escrow wallets
    description: Wallets that only move funds through a verified proposal.
  - name: Trader
    description: Liveness reports from trader containers.
  - name: Gas sponsorship
    description: Sponsored gas for trader instances on Polygon.
  - name: Status
    description: Public deployment facts for checking receipts.
paths:
  /api/v1/trader/heartbeat:
    post:
      tags:
        - Trader
      summary: Report trader status
      description: >-
        A trader container reports liveness and headline numbers. Upserts one
        record per `instanceId`. Free.
      operationId: traderHeartbeat
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TraderHeartbeat'
      responses:
        '200':
          description: Recorded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
        '400':
          description: Invalid body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                e0:
                  summary: invalid JSON body
                  value:
                    error: invalid JSON body
                e1:
                  summary: invalid_body
                  value:
                    error: invalid_body
                    message: 'instanceId: Invalid uuid'
        '401':
          description: No API key, or the key is unknown or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                e0:
                  summary: missing API key (send x-api-key)
                  value:
                    error: missing API key (send x-api-key)
                e1:
                  summary: invalid or revoked API key
                  value:
                    error: invalid or revoked API key
components:
  schemas:
    TraderHeartbeat:
      type: object
      required:
        - instanceId
        - name
        - version
        - status
        - dryRun
        - venue
        - env
        - walletAddress
        - startedAt
        - lastTickAt
        - openPositions
        - totalExposureUsd
        - dailyRealizedPnlUsd
        - creditsRemaining
      properties:
        instanceId:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
          maxLength: 64
        version:
          type: string
          minLength: 1
          maxLength: 64
        status:
          type: string
          enum:
            - starting
            - running
            - paused_out_of_credits
            - stopping
            - error
        dryRun:
          type: boolean
        venue:
          type: string
          minLength: 1
          maxLength: 32
          example: dimes
        env:
          type: string
          enum:
            - sandbox
            - production
        walletAddress:
          type: string
          pattern: ^0x[0-9a-fA-F]{40}$
        startedAt:
          type: string
          format: date-time
        lastTickAt:
          type: string
          nullable: true
          format: date-time
        openPositions:
          type: integer
          minimum: 0
        totalExposureUsd:
          type: number
        dailyRealizedPnlUsd:
          type: number
        creditsRemaining:
          type: number
          nullable: true
        note:
          type: string
          maxLength: 280
          nullable: true
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: >-
            An error code (for example `out_of_credits`) or a short sentence
            (for example `intent is required`).
        message:
          type: string
          description: Detail, when present.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: An API key (`chance_sk_live_…`) from https://harness.chance.cc/keys.
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        The same API key sent as `Authorization: Bearer <key>`. If both headers
        are sent, `x-api-key` is used.

````