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

> Submit what the agent is mandated to do (`intent`) and the action it proposes to take (`action`). An independent judge model checks the action against the intent and returns a verdict — `ALLOW`, `BLOCK`, or `ESCALATE` — with its reasoning and a provable receipt. Fail-closed: treat anything other than `ALLOW` as do-not-execute. Costs one credit.



## OpenAPI

````yaml /openapi.json post /api/v1/intent
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/intent:
    post:
      summary: Verify an intent
      description: >-
        Submit what the agent is mandated to do (`intent`) and the action it
        proposes to take (`action`). An independent judge model checks the
        action against the intent and returns a verdict — `ALLOW`, `BLOCK`, or
        `ESCALATE` — with its reasoning and a provable receipt. Fail-closed:
        treat anything other than `ALLOW` as do-not-execute. Costs one credit.
      operationId: verifyIntent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IntentRequest'
            examples:
              longshot:
                summary: A 95%-favorites bot tries a longshot
                value:
                  intent: >-
                    Only buy favorites priced >= 95c. Reject longshots. Max $10
                    per market.
                  action: Buy YES on the Will-X-win market @ 21c for $10.
      responses:
        '201':
          description: Verdict produced.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Verdict'
        '400':
          description: Missing `intent` or `action`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, invalid, or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            Out of credits. The body includes a `topup` object pointing at POST
            /api/v1/credits/topup (x402, USDC on Base).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    IntentRequest:
      type: object
      required:
        - intent
        - action
      properties:
        intent:
          type: string
          description: What the agent is mandated to do — its policy, thesis, or rules.
          example: >-
            Only buy favorites priced >= 95c. Reject longshots. Max $10 per
            market.
        action:
          type: string
          description: >-
            The specific action the agent proposes to take, checked against the
            intent.
          example: Buy YES on the Will-X-win market @ 21c for $10.
        context:
          type: object
          additionalProperties: true
          description: Optional extra context for the judge (any JSON object).
        preset:
          type: string
          description: The judge lens to apply.
          default: pretrade
    Verdict:
      type: object
      properties:
        id:
          type: string
          description: Verification id (UUID).
        requestHash:
          type: string
          description: Stable 0x… id for this verification.
        status:
          type: string
          example: COMPLETED
        verdict:
          type: string
          enum:
            - ALLOW
            - BLOCK
            - ESCALATE
          description: >-
            ALLOW = matches intent; BLOCK = violates it; ESCALATE = genuinely
            ambiguous, needs a human.
        reasoning:
          type: string
          nullable: true
        proof:
          $ref: '#/components/schemas/Proof'
        creditsRemaining:
          type: integer
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    Proof:
      type: object
      description: The receipt that makes the verdict independently verifiable.
      properties:
        transcriptRoot:
          type: string
          nullable: true
          description: Root of the hash-chained transcript of the whole run.
        outputHash:
          type: string
          nullable: true
        signature:
          type: string
          nullable: true
          description: Judge signature over the run digest.
        judge:
          type: string
          nullable: true
          description: Judge address that signed.
        attested:
          type: boolean
          description: True when the judge key ran inside an attested TEE.
        anchorTx:
          type: string
          nullable: true
          description: Onchain anchor transaction hash.
        anchorVerified:
          type: boolean
        transcriptUri:
          type: string
          nullable: true
          description: Public URL of the full transcript.
        explorerTx:
          type: string
          nullable: true
          description: Block-explorer link for the anchor.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Chance API key (chance_sk_…), created in the dashboard.

````