> ## 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.

# Credits balance + top-up terms

> Returns the API key's remaining credit balance and, when top-ups are enabled, the x402 payment terms for POST /api/v1/credits/topup. Free — never charges a credit.



## OpenAPI

````yaml /openapi.json get /api/v1/credits
openapi: 3.0.3
info:
  title: Chance Verification API
  version: 1.0.0
  description: >-
    Verify an AI agent's proposed action against its stated intent, and get back
    a verdict with a provable receipt — hash-chained, signed by an attested
    judge key, and anchored onchain.
servers:
  - url: https://harness.chance.cc
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/credits:
    get:
      summary: Credits balance + top-up terms
      description: >-
        Returns the API key's remaining credit balance and, when top-ups are
        enabled, the x402 payment terms for POST /api/v1/credits/topup. Free —
        never charges a credit.
      operationId: getCredits
      responses:
        '200':
          description: Balance and top-up terms.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsStatus'
        '401':
          description: Missing, invalid, or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreditsStatus:
      type: object
      properties:
        creditsRemaining:
          type: integer
          example: 42
        priceUsdPerCredit:
          type: number
          example: 0.05
        topup:
          type: object
          description: x402 top-up terms (shape varies with availability).
          properties:
            available:
              type: boolean
            protocol:
              type: string
              example: x402
            method:
              type: string
              example: POST
            url:
              type: string
              example: https://harness.chance.cc/api/v1/credits/topup?credits=N
            network:
              type: string
              example: eip155:8453
            asset:
              type: string
              example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
            payTo:
              type: string
            minCredits:
              type: integer
              example: 20
            maxCredits:
              type: integer
              example: 10000
            note:
              type: string
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Chance API key (chance_sk_…), created in the dashboard.

````