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

# Update Pricing

> Update x402 pay-per-crawl pricing for a site — set the default USDC price and path-specific pricing rules for AI agent content access.

<RequestExample>
  ```bash theme={null}
  curl -X PUT https://xenarch.dev/v1/sites/b2c3d4e5.../pricing \
    -H "Authorization: Bearer xk_pub_abc123..." \
    -H "Content-Type: application/json" \
    -d '{
      "default_price_usd": "0.003",
      "rules": [
        {"path_pattern": "/premium/*", "price_usd": "0.01"},
        {"path_pattern": "/api/*", "price_usd": "0.05"},
        {"path_pattern": "/public/*", "price_usd": "0"}
      ]
    }'
  ```
</RequestExample>

## Notes

* `path_pattern` uses fnmatch-style globs: `*` matches a single segment, `**` is not supported at the API level
* Rules are evaluated in order — first match wins
* A price of `"0"` makes the path free for bots
* Replaces all existing rules for the site


## OpenAPI

````yaml PUT /v1/sites/{site_id}/pricing
openapi: 3.1.0
info:
  title: Xenarch Platform
  version: 0.1.0
servers: []
security: []
paths:
  /v1/sites/{site_id}/pricing:
    put:
      tags:
        - sites
      summary: Update Pricing
      operationId: update_pricing_v1_sites__site_id__pricing_put
      parameters:
        - name: site_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Site Id
        - name: authorization
          in: header
          required: true
          schema:
            type: string
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SitePricingRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SitePricingResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SitePricingRequest:
      properties:
        default_price_usd:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Default Price Usd
        rules:
          items:
            $ref: '#/components/schemas/PriceRuleItem'
          type: array
          title: Rules
          default: []
      type: object
      required:
        - default_price_usd
      title: SitePricingRequest
    SitePricingResponse:
      properties:
        rules_applied:
          type: integer
          title: Rules Applied
      type: object
      required:
        - rules_applied
      title: SitePricingResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PriceRuleItem:
      properties:
        path:
          type: string
          title: Path
        price_usd:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Price Usd
      type: object
      required:
        - path
        - price_usd
      title: PriceRuleItem
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````