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

> Register a discoverable x402 service on Xenarch — make your API or data accessible to AI agents with machine-readable pricing and USDC gates.

<RequestExample>
  ```bash theme={null}
  curl -X POST https://xenarch.dev/v1/services \
    -H "Authorization: Bearer xk_pub_abc123..." \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Premium News API",
      "url": "https://example.com/api",
      "description": "Real-time news articles with full text",
      "price_per_request": "0.05",
      "category": "api",
      "pay_json_url": "https://example.com/.well-known/pay.json"
    }'
  ```
</RequestExample>

## Categories

| Value     | Description                       |
| --------- | --------------------------------- |
| `api`     | REST or GraphQL API               |
| `docs`    | Documentation or knowledge base   |
| `data`    | Data feeds or datasets            |
| `content` | Articles, media, or other content |


## OpenAPI

````yaml POST /v1/services
openapi: 3.1.0
info:
  title: Xenarch Platform
  version: 0.1.0
servers: []
security: []
paths:
  /v1/services:
    post:
      tags:
        - services
      summary: Create Service Endpoint
      description: Register a new service for agent discovery.
      operationId: create_service_endpoint_v1_services_post
      parameters:
        - name: authorization
          in: header
          required: true
          schema:
            type: string
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceCreateRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ServiceCreateRequest:
      properties:
        name:
          type: string
          maxLength: 200
          minLength: 1
          title: Name
        url:
          type: string
          minLength: 1
          title: Url
        description:
          type: string
          maxLength: 2000
          title: Description
          default: ''
        price_per_request:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Price Per Request
        category:
          type: string
          pattern: ^(api|docs|data|content)$
          title: Category
          default: api
        pay_json_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Pay Json Url
      type: object
      required:
        - name
        - url
        - price_per_request
      title: ServiceCreateRequest
    ServiceResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        publisher_id:
          type: string
          format: uuid
          title: Publisher Id
        name:
          type: string
          title: Name
        url:
          type: string
          title: Url
        description:
          type: string
          title: Description
        price_per_request:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Price Per Request
        category:
          type: string
          title: Category
        pay_json_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Pay Json Url
        is_active:
          type: boolean
          title: Is Active
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - publisher_id
        - name
        - url
        - description
        - price_per_request
        - category
        - pay_json_url
        - is_active
        - created_at
        - updated_at
      title: ServiceResponse
    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

````