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

# Get X402 payment requirements for generation

> Get payment details for generation. This will include the USDC on Solana payment requirements, and follows the x402 (v2) standard for payment requests. The `402` response already carries the same details, so most X402 clients skip this call.



## OpenAPI

````yaml post /payment_request/x402
openapi: 3.0.1
info:
  title: markdown2pdf
  version: '2025-06-10T15:55:31Z'
servers:
  - url: https://api.markdown2pdf.ai
security: []
paths:
  /payment_request/x402:
    post:
      summary: Get X402 payment requirements for generation
      description: >-
        Get payment details for generation. This will include the USDC on Solana
        payment requirements, and follows the x402 (v2) standard for payment
        requests. The `402` response already carries the same details, so most
        X402 clients skip this call.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JobX402PaymentRequest'
        required: true
      responses:
        '200':
          description: x402 payment requirements for the offer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobX402PaymentRequestResponse'
        '404':
          description: >-
            If the offer_id is not an x402 offer for the given
            payment_context_token.
          content: {}
        '422':
          description: If the request body is invalid or missing required fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    JobX402PaymentRequest:
      title: JobX402PaymentRequest
      required:
        - offer_id
        - payment_context_token
      type: object
      properties:
        offer_id:
          title: Offer Id
          type: string
          description: Id of the x402 offer from the `402` response.
        payment_context_token:
          title: Payment Context Token
          type: string
          description: Token to identify the payment context
    JobX402PaymentRequestResponse:
      title: JobX402PaymentRequestResponse
      type: object
      properties:
        version:
          title: Version
          type: string
          description: Version of the payment request response schema
        x402_version:
          title: x402 Version
          type: integer
          example: 2
        accepts:
          title: Accepts
          type: array
          items:
            $ref: '#/components/schemas/X402Accept'
        resource:
          title: Resource
          type: string
          description: URL of the protected resource.
        expires_at:
          title: Expires At
          type: string
          format: date-time
          nullable: true
          description: Expiration time for the payment requirements
    HTTPValidationError:
      title: HTTPValidationError
      type: object
      properties:
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    X402Accept:
      title: X402Accept
      description: An x402 v2 payment requirement.
      type: object
      properties:
        scheme:
          type: string
          example: exact
        network:
          type: string
          description: CAIP-2 network identifier.
          example: solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
        asset:
          type: string
          description: Token mint address (USDC on Solana).
          example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
        amount:
          type: string
          description: >-
            Amount in the asset's base units. USDC has 6 decimals, so `400000` =
            0.40 USDC.
          example: '400000'
        payTo:
          type: string
          description: Recipient address.
        maxTimeoutSeconds:
          type: integer
          example: 300
        extra:
          type: object
          description: Scheme-specific extras, e.g. `feePayer` for Solana.
          additionalProperties: true
    ValidationError:
      title: ValidationError
      required:
        - loc
        - msg
        - type
      type: object
      properties:
        loc:
          title: Location
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
                format: int32
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.