> ## 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.

# Create Site

> Register a new site (domain) under the publisher account — first step to enable x402 pay-per-crawl with USDC micropayments for AI agents.

<RequestExample>
  ```bash theme={null}
  curl -X POST https://xenarch.dev/v1/sites \
    -H "Authorization: Bearer xk_pub_abc123..." \
    -H "Content-Type: application/json" \
    -d '{"domain": "example.com"}'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
    "site_token": "st_xyz789..."
  }
  ```
</ResponseExample>

## Notes

* **Save the `site_token`** — it is returned once and stored as a SHA-256 hash
* Domain must be unique across all publishers
* The site token is used by your middleware to create gates


## OpenAPI

````yaml POST /v1/sites
openapi: 3.1.0
info:
  title: Xenarch Platform
  version: 0.1.0
servers: []
security: []
paths:
  /v1/sites:
    post:
      tags:
        - sites
      summary: Create Site
      operationId: create_site_v1_sites_post
      parameters:
        - name: authorization
          in: header
          required: true
          schema:
            type: string
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SiteCreateRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SiteCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SiteCreateRequest:
      properties:
        domain:
          type: string
          maxLength: 253
          minLength: 1
          title: Domain
      type: object
      required:
        - domain
      title: SiteCreateRequest
    SiteCreateResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        site_token:
          type: string
          title: Site Token
      type: object
      required:
        - id
        - site_token
      title: SiteCreateResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````