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

# Verify an action

> Checks `action` against `intent` and returns a verdict with its receipt. Runs synchronously. Costs one credit; a run that errors is refunded. Execute only on `ALLOW`.



## OpenAPI

````yaml /openapi.json post /api/v1/intent
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/intent:
    post:
      tags:
        - Verification
      summary: Verify an action
      description: >-
        Checks `action` against `intent` and returns a verdict with its receipt.
        Runs synchronously. Costs one credit; a run that errors is refunded.
        Execute only on `ALLOW`.
      operationId: verifyIntent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IntentRequest'
            examples:
              string:
                summary: String action
                value:
                  intent: >-
                    Only buy favorites priced at or above 95c. No longshots. Max
                    $10 per market.
                  action: Buy YES on the Will-X-win market at 21c for $10.
              structured:
                summary: Exact venue payload
                value:
                  intent: Long BTC only. Max $500 notional. No leverage above 3x.
                  venue: hyperliquid
                  action:
                    type: order
                    orders:
                      - a: 0
                        b: true
                        p: '65000'
                        s: '0.005'
                        r: false
                        t:
                          limit:
                            tif: Gtc
                    grouping: na
                  context:
                    btcMid: 64950
      responses:
        '201':
          description: Verdict produced.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerificationCreated'
        '400':
          description: Body is not JSON, or `intent` or `action` is missing or empty.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                e0:
                  summary: invalid JSON body
                  value:
                    error: invalid JSON body
                e1:
                  summary: intent is required
                  value:
                    error: intent is required
                e2:
                  summary: action is required
                  value:
                    error: action is required
        '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
        '402':
          description: >-
            Out of credits. Not payable with x402: there is no PAYMENT-REQUIRED
            header. Buy credits at `/api/v1/credits/topup`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OutOfCredits'
              example:
                error: out_of_credits
                message: No credits remaining. …
                topup:
                  protocol: x402
                  method: POST
                  url: https://harness.chance.cc/api/v1/credits/topup?credits=N
                  network: eip155:8453
                  asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
                  priceUsdPerCredit: 0.05
                  minCredits: 20
                  maxCredits: 10000
        '502':
          description: The run failed. The credit was refunded. Do not execute.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: verification_failed
                message: …
components:
  schemas:
    IntentRequest:
      type: object
      required:
        - intent
        - action
      properties:
        intent:
          type: string
          description: >-
            The rules the action must satisfy: mandate, limits, thesis. Must be
            non-empty after trimming.
          example: >-
            Only buy favorites priced at or above 95c. No longshots. Max $10 per
            market.
        action:
          description: >-
            The proposed action. A string is judged as written (`mode:
            semantic`). An object is classified by a venue adapter when one
            matches (`mode: structured`); an unmatched object is judged as JSON
            (`mode: semantic`).
          oneOf:
            - type: string
              example: Buy YES on the Will-X-win market at 21c for $10.
            - type: object
              additionalProperties: true
        venue:
          type: string
          description: >-
            Venue adapter to use. Ids: hyperliquid, limitless, polymarket,
            dimes, myriad, orderly, derive, lifi, meow, liquid, robinhood, x402,
            agentcards, uniswap, solana, starknet, alchemy. The value is
            lowercased, stripped of punctuation and matched against ids, aliases
            (`hl`, `poly`, `evm`, `eth`, `base`, `sol`, `rh`, `lyra`, ...) and
            id prefixes. An unknown value is ignored and object actions fall
            back to structural detection.
          example: hyperliquid
        context:
          type: object
          additionalProperties: true
          description: >-
            Facts for the judge, shown as JSON under CONTEXT.
            `context.reference` is handled separately.
          properties:
            reference:
              $ref: '#/components/schemas/Reference'
        preset:
          type: string
          default: generic
          description: >-
            Judge prompt. Omit it; `generic` is the documented value and the
            fallback for any unknown value.
    VerificationCreated:
      type: object
      properties:
        id:
          type: string
          description: Verification id (UUID).
        requestHash:
          type: string
          description: Per-run identifier (0x, 32 bytes). Not a hash of the payload.
        status:
          type: string
          enum:
            - COMPLETED
        verdict:
          type: string
          nullable: true
          enum:
            - ALLOW
            - BLOCK
            - ESCALATE
            - null
          description: >-
            Execute only on `ALLOW`. `BLOCK`, `ESCALATE` and `null` mean do not
            execute.
        reasoning:
          type: string
          nullable: true
          description: The judge's decisive reason.
        mode:
          type: string
          enum:
            - structured
            - semantic
        venue:
          type: string
          nullable: true
          description: Adapter id used, or null.
        actionFamily:
          type: string
          nullable: true
          description: >-
            order, margin, withdrawal, transfer, staking, vault, position, swap,
            payment, subaccount, permission or unknown. Null without a venue.
        actionType:
          type: string
          nullable: true
          description: >-
            The venue's own action name as submitted, when the classifier found
            one.
        proof:
          $ref: '#/components/schemas/CreatedProof'
        creditsRemaining:
          type: integer
    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.
    OutOfCredits:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          enum:
            - out_of_credits
        message:
          type: string
        topup:
          $ref: '#/components/schemas/TopupPointer'
    Reference:
      type: object
      required:
        - excerpt
      description: >-
        Third-party documentation for the tool being called. The judge sees it
        fenced, as background that may be wrong and never authorizes the action.
        Any other shape stays in CONTEXT.
      properties:
        source:
          type: string
          description: Where the excerpt came from. Cut at 300 characters.
        excerpt:
          type: string
          description: >-
            Non-empty text. Trimmed, fence markers removed, cut at 4,000
            characters with `[…]` appended.
    CreatedProof:
      type: object
      properties:
        transcriptRoot:
          type: string
          nullable: true
          description: Head of the transcript hash chain.
        outputHash:
          type: string
          nullable: true
          description: keccak256 of the judge's full output text.
        signature:
          type: string
          nullable: true
          description: EIP-191 signature by the judge key over the run digest.
        judge:
          type: string
          nullable: true
          description: Address of the judge key.
        attested:
          type: boolean
          description: True when the signing key's attestation mode is Azure SEV-SNP.
        anchorTx:
          type: string
          nullable: true
          description: Anchor transaction hash. Null when anchoring was skipped or failed.
        anchorVerified:
          type: boolean
          description: >-
            True when the registry confirmed the record after the anchor
            transaction.
        transcriptUri:
          type: string
          description: >-
            `/api/runs/{runId}/transcript`. Owner-only: send the owning
            account's API key, or open `/verify/{runId}` signed in.
        explorerTx:
          type: string
          nullable: true
          description: >-
            Explorer link for the anchor: basescan.org for Base, voyager.online
            for Starknet.
    TopupPointer:
      type: object
      description: >-
        Where to buy credits. Present only when top-ups are enabled on the
        deployment.
      properties:
        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'
        priceUsdPerCredit:
          type: number
          example: 0.05
        minCredits:
          type: integer
          example: 20
        maxCredits:
          type: integer
          example: 10000
  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.

````