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

# Request a signed quote

> Ask the seller what one call will cost before paying. Free and unauthenticated. The seller prices the estimate with the endpoint's pricing model and returns a Quote signed by its Hedera account key, valid for about two minutes. Pass maxAmount to counter below list price: the seller accepts any offer at or above its floor (85% of list by default) and answers 409 with minimumAmount below it. Put quote.quoteId in the body (POST) or query string (GET) of the paid request and the 402 will carry exactly the agreed amount; a quote is consumed by the settlement, so it cannot be replayed.



## OpenAPI

````yaml /openapi.yaml post /a2a/quote
openapi: 3.1.0
info:
  title: Agora402 seller API
  version: 1.0.0
  description: >-
    HTTP API served by every Agora402 seller: free discovery documents, a free
    quote endpoint, and paid endpoints gated by x402 and settled on Hedera
    through the Blocky402 facilitator. Typical agent flow: getManifest (what is
    sold, at what price, paid to which account) -> requestQuote (lock a signed
    price, counter below list if you like) -> call the paid endpoint with the
    quoteId. The first call answers 402 with a PAYMENT-REQUIRED header; the
    retry carries PAYMENT-SIGNATURE; the response carries PAYMENT-RESPONSE with
    the Hedera transaction id. Then read listReceipts or the seller's HCS
    receipts topic to audit what was charged. All amounts are decimal strings in
    atomic units of the asset (tinybars for HBAR, 8 decimals); timestamps are
    ISO 8601 unless stated; quote expiry is unix seconds.
servers:
  - url: http://localhost:4402
    description: Local services seller (npm run dev)
  - url: http://localhost:4404
    description: Local auditor (npm run dev)
security: []
tags:
  - name: Discovery
    description: Free documents that describe the seller. Read these before paying anyone.
  - name: Negotiation
    description: Free, signed, time-limited price quotes.
  - name: Paid services
    description: x402-gated endpoints. Every call is a Hedera micropayment.
  - name: Trust
    description: Paid audits of other sellers, attested on the HCS audit topic.
  - name: Receipts
    description: What this seller has been paid for.
paths:
  /a2a/quote:
    post:
      tags:
        - Negotiation
      summary: Request a signed quote
      description: >-
        Ask the seller what one call will cost before paying. Free and
        unauthenticated. The seller prices the estimate with the endpoint's
        pricing model and returns a Quote signed by its Hedera account key,
        valid for about two minutes. Pass maxAmount to counter below list price:
        the seller accepts any offer at or above its floor (85% of list by
        default) and answers 409 with minimumAmount below it. Put quote.quoteId
        in the body (POST) or query string (GET) of the paid request and the 402
        will carry exactly the agreed amount; a quote is consumed by the
        settlement, so it cannot be replayed.
      operationId: requestQuote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuoteRequest'
            examples:
              counter:
                summary: Counter below list price
                value:
                  endpointId: infer
                  estimate:
                    inputTokens: 120
                    maxOutputTokens: 256
                  asset: 0.0.0
                  maxAmount: '60000'
                  buyer: >-
                    uaid:aid:9GvnzC1pJ7yA4WQ2E;uid=agora-buyer;registry=agora402;proto=a2a;nativeId=hedera:testnet:0.0.4009876
              list:
                summary: Accept the list price
                value:
                  endpointId: hbar-rate
                  estimate:
                    units: 1
      responses:
        '200':
          description: Signed quote
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteResponse'
              example:
                quote:
                  quoteId: q_5f1c2a9b7d3e4c6a8b0f1e2d
                  seller: >-
                    uaid:aid:2NEpo7TZRRrLZSi2U;uid=agora-demo-seller;registry=agora402;proto=a2a;nativeId=hedera:testnet:0.0.5001234;domain=localhost:4402
                  endpointId: infer
                  network: hedera:testnet
                  asset: 0.0.0
                  amount: '60000'
                  expiresAt: 1789560120
                  basis:
                    pricing:
                      kind: per-token
                      base: '50000'
                      inputPer1k: '20000'
                      outputPer1k: '60000'
                    estimate:
                      inputTokens: 120
                      maxOutputTokens: 256
                    listPrice: '67760'
                    countered: true
                    buyer: >-
                      uaid:aid:9GvnzC1pJ7yA4WQ2E;uid=agora-buyer;registry=agora402;proto=a2a;nativeId=hedera:testnet:0.0.4009876
                  signature: >-
                    3045022100a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f9002200f1e2d3c4b5a69788796a5b4c3d2e1f00f1e2d3c4b5a69788796a5b4c3d2e1f0
                  signerPublicKey: >-
                    302d300706052b8104000a032200027a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f9
                countered: true
        '400':
          description: Invalid body, or the endpoint does not accept the requested asset
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteRejection'
              examples:
                invalid:
                  value:
                    error: invalid quote request
                    issues:
                      - code: invalid_type
                        path:
                          - endpointId
                        message: Required
                asset:
                  value:
                    error: endpoint infer does not accept asset 0.0.7777
        '404':
          description: Unknown endpointId
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteRejection'
              example:
                error: unknown endpoint translate
        '409':
          description: >-
            Offer below the seller's floor. Raise maxAmount to at least
            minimumAmount, or omit it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteRejection'
              example:
                error: offer below floor
                minimumAmount: '57596'
                listPrice: '67760'
components:
  schemas:
    QuoteRequest:
      type: object
      required:
        - endpointId
      properties:
        endpointId:
          type: string
          description: id of the endpoint in the manifest, e.g. infer or hbar-rate
        estimate:
          type: object
          description: >-
            The work to price. Which fields matter depends on the pricing model
            kind.
          properties:
            inputTokens:
              type: integer
              minimum: 0
              description: per-token models, about 4 characters per token
            maxOutputTokens:
              type: integer
              minimum: 0
              description: per-token models, the max_tokens you will send
            units:
              type: integer
              minimum: 0
              description: per-unit models, defaults to 1
        maxAmount:
          type: string
          pattern: ^\d+$
          description: >-
            Your ceiling in atomic units. At or above list you pay list; between
            floor and list the seller accepts your counter; below floor you get
            409.
        asset:
          type: string
          pattern: ^\d+\.\d+\.\d+$
          default: 0.0.0
          description: Asset to pay in. 0.0.0 is HBAR.
        buyer:
          type: string
          description: Your uaid, informational, echoed in basis.buyer
    QuoteResponse:
      type: object
      required:
        - quote
        - countered
      properties:
        quote:
          $ref: '#/components/schemas/Quote'
        countered:
          type: boolean
          description: true when the seller accepted your maxAmount below list price
    QuoteRejection:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        issues:
          type: array
          description: Zod validation issues, only on invalid bodies
          items:
            type: object
            additionalProperties: true
        minimumAmount:
          type: string
          pattern: ^\d+$
          description: The least the seller will take (409 only)
        listPrice:
          type: string
          pattern: ^\d+$
          description: Undiscounted price (409 only)
    Quote:
      type: object
      description: A priced, time-limited offer signed by the seller account key
      required:
        - quoteId
        - seller
        - endpointId
        - network
        - asset
        - amount
        - expiresAt
        - basis
        - signature
        - signerPublicKey
      properties:
        quoteId:
          type: string
          minLength: 8
          description: q_ followed by 24 hex. Send it with the paid request.
        seller:
          $ref: '#/components/schemas/Uaid'
        endpointId:
          type: string
        network:
          $ref: '#/components/schemas/Network'
        asset:
          $ref: '#/components/schemas/HederaEntityId'
        amount:
          $ref: '#/components/schemas/Amount'
          description: Exactly what the 402 will ask for when the quote is used
        expiresAt:
          type: integer
          description: Unix seconds. About 120 seconds after issue.
        basis:
          type: object
          additionalProperties: true
          description: >-
            What the price covers, for auditability. The seller includes
            pricing, estimate, listPrice, countered and buyer.
        signature:
          type: string
          description: >-
            Hex ECDSA or ED25519 signature over the canonical quote body (sorted
            keys, everything but signature and signerPublicKey)
        signerPublicKey:
          type: string
          description: >-
            Hex DER public key of the seller account. Verify it matches the
            account in payTo.
    Uaid:
      type: string
      pattern: '^uaid:'
      description: HCS-14 universal agent id
      example: >-
        uaid:aid:2NEpo7TZRRrLZSi2U;uid=agora-demo-seller;registry=agora402;proto=a2a;nativeId=hedera:testnet:0.0.5001234;domain=localhost:4402
    Network:
      type: string
      enum:
        - hedera:testnet
        - hedera:mainnet
      description: CAIP-2 network id
    HederaEntityId:
      type: string
      pattern: ^\d+\.\d+\.\d+$
      description: Hedera entity id, shard.realm.num
      example: 0.0.5001234
    Amount:
      type: string
      pattern: ^\d+$
      description: >-
        Atomic units of the asset as a decimal string (tinybars for HBAR). Never
        a float.
      example: '60000'

````