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

# Generate a dual payment challenge

> Generates both an MPP (WWW-Authenticate) and x402 (PAYMENT-REQUIRED)
challenge for a pay-walled endpoint. Called internally by the Prudra
Express SDK's payMiddleware — developers do not call this directly.

Rate limited to 20 requests per IP per 60 seconds.




## OpenAPI

````yaml post /payments/challenge
openapi: 3.0.0
info:
  title: Prudra API
  version: 1.0.0
  description: |-
    The Infrastructure Layer for Enterprise AI Agents.

    **Base URL:** `https://api.prudra.dev`

    **Authentication:** All endpoints require a Bearer token.
    Pass your API key in the `Authorization` header:
    `Authorization: Bearer prv_live_sk_...`

    Use `prv_test_sk_...` keys for development.
    Test keys accept `PAYMENT_STUB_MODE` payments.
  contact:
    name: Prudra Support
    email: support@prudra.com
    url: https://prudra.com
servers:
  - url: https://api.prudra.dev
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Payments
    description: Payment verification and challenge generation
  - name: Sessions
    description: Multi-step session payment management
  - name: Vaults
    description: Persistent agent workspace storage
  - name: Wallets
    description: Managed wallet provisioning and BYO wallet registration
  - name: Transfers
    description: Token transfers between addresses
  - name: Withdrawals
    description: Fund withdrawals to bank accounts
  - name: Webhooks
    description: Outbound event delivery
  - name: Billing
    description: Usage monitoring and plan management
  - name: Organisation
    description: API key and organisation management
  - name: Account
    description: Account profile and organisation payment logs
  - name: Registry
    description: Pay-walled route registry snapshots
  - name: Chains
    description: Supported chain and token metadata
  - name: Organisation wallet
    description: Legacy Tempo receiving wallet (single wallet per org)
paths:
  /payments/challenge:
    post:
      tags:
        - Payments
      summary: Generate a dual payment challenge
      description: |
        Generates both an MPP (WWW-Authenticate) and x402 (PAYMENT-REQUIRED)
        challenge for a pay-walled endpoint. Called internally by the Prudra
        Express SDK's payMiddleware — developers do not call this directly.

        Rate limited to 20 requests per IP per 60 seconds.
      operationId: createPaymentChallenge
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - walletId
                - hostname
                - price
              properties:
                walletId:
                  type: string
                hostname:
                  type: string
                price:
                  type: string
                description:
                  type: string
                  nullable: true
                intent:
                  type: string
                  enum:
                    - charge
                    - session
                  default: charge
                acceptX402:
                  type: boolean
                  default: true
                acceptMPP:
                  type: boolean
                  default: true
      responses:
        '200':
          description: Challenge generated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChallengeResponse'
        '422':
          description: Wallet not found or not in this organisation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
        '429':
          description: Challenge rate limit exceeded
components:
  schemas:
    ChallengeResponse:
      type: object
      properties:
        mpp:
          type: string
          nullable: true
          description: WWW-Authenticate MPP challenge string
        x402:
          type: string
          nullable: true
          description: X-PAYMENT-REQUIREMENTS base64 value
    ProblemDetail:
      type: object
      description: RFC 9457 problem detail response
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
      required:
        - type
        - title
        - status
        - detail
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: Prudra API Key
      description: Your Prudra API key. Get one at dashboard.prudra.com/settings/api-keys

````