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

# Simulate relay payment

> Dry-run simulation that returns relay payment requirements including fees without executing payment.

**Fee Model:**
- Flat 3% 
- This ensures gas costs are covered while remaining competitive with Web2 payment processors




## OpenAPI

````yaml post /relay/sim
openapi: 3.0.0
info:
  title: HTTPayer Proxy API
  version: 1.0.0
  description: >-
    HTTPayer is a payment router for 402 response codes and the x402 Protocol.
    Users can access APIs that use the x402 standard through the HTTPayer proxy.
  contact:
    name: HTTPayer Team
    url: https://httpayer.com
servers:
  - url: https://api.httpayer.com
    description: Production server
security: []
tags:
  - name: Relay
    description: Cross-chain payment relay endpoints
  - name: Account
    description: Account balance and limits endpoints
  - name: Webhooks
    description: Async task status and webhooks
  - name: LLM
    description: OpenAI-powered endpoints for translation and chat
  - name: Health
    description: Health check endpoints
paths:
  /relay/sim:
    post:
      tags:
        - Relay
      summary: Simulate relay payment
      description: >
        Dry-run simulation that returns relay payment requirements including
        fees without executing payment.


        **Fee Model:**

        - Flat 3% 

        - This ensures gas costs are covered while remaining competitive with
        Web2 payment processors
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RelayRequest'
      responses:
        '200':
          description: Simulation completed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  requiresPayment:
                    type: boolean
                    description: Whether the target API requires payment
                  targetPaymentRequirements:
                    $ref: '#/components/schemas/PaymentRequirements'
                  relayFeeBreakdown:
                    type: object
                    properties:
                      targetAmount:
                        type: number
                        description: Amount required by target API in USDC
                        example: 0.01
                      relayFee:
                        type: number
                        description: HTTPayer relay fee in USDC
                        example: 0.0003
                      totalAmount:
                        type: number
                        description: Total amount to pay including relay fee in USDC
                        example: 0.0103
                      relayFeePercentage:
                        type: number
                        description: Relay fee percentage
                        example: 3
                      relayFeeMinUSDC:
                        type: number
                        description: Minimum relay fee in USDC
                        example: 0.002
                      feeModel:
                        type: string
                        description: Human-readable fee model description
                        example: 3% with $0.002 minimum
                  message:
                    type: string
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Simulation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    RelayRequest:
      type: object
      properties:
        api_url:
          type: string
          description: The target API URL to call via the relay
          example: https://demo.httpayer.com/base-weather
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - DELETE
            - PATCH
          description: HTTP method for the target API
          example: GET
        json:
          type: object
          description: >-
            JSON body — serialized with Content-Type: application/json. Mirrors
            Python requests(json=...).
        data:
          description: >-
            Form-encoded body (object) or raw string body (string). Mirrors
            Python requests(data=...).
          oneOf:
            - type: object
            - type: string
        body:
          type: string
          description: >-
            Pre-serialized body string passed through unchanged — Content-Type
            is NOT set automatically. If you pass an object it will be
            JSON-stringified, but you must set Content-Type: application/json
            via headers yourself. Use json instead for automatic Content-Type
            handling.
        payload:
          type: object
          description: Deprecated alias for json. Use json instead.
        params:
          type: object
          description: Query parameters appended to the target URL
        headers:
          type: object
          description: Custom headers forwarded to the target API
          example:
            X-API-KEY: your-target-api-key
            Authorization: Bearer token123
        auth:
          type: object
          description: >-
            Basic auth shorthand — converted to Authorization: Basic <base64>.
            Mirrors Python requests(auth=(...)).
          properties:
            username:
              type: string
            password:
              type: string
        cookies:
          type: object
          description: >-
            Cookie shorthand — merged into the Cookie header. Mirrors Python
            requests(cookies={...}).
          example:
            session: abc123
        network:
          type: string
          enum:
            - base
            - base-sepolia
            - skale-base
            - skale-base-sepolia
            - solana
            - solana-mainnet-beta
            - solana-devnet
          description: Blockchain network to use for payment
          example: base
      required:
        - api_url
        - method
    PaymentRequirements:
      type: object
      properties:
        scheme:
          type: string
          example: exact
        network:
          type: string
          example: base
        payTo:
          type: string
          description: Recipient address
        asset:
          type: string
          description: Token contract address
        maxAmountRequired:
          type: string
          description: Amount in microUSDC
        resource:
          type: string
          description: Resource URL
        description:
          type: string
        mimeType:
          type: string
          example: application/json
        maxTimeoutSeconds:
          type: number
          example: 180
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
        details:
          type: string
          description: Additional error details

````