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

# Register Agent

> Register an AI agent with Xenarch by wallet address — one-time registration for agents making USDC micropayments via the x402 protocol.

<RequestExample>
  ```bash theme={null}
  curl -X POST https://xenarch.dev/v1/agents \
    -H "Content-Type: application/json" \
    -d '{"wallet_address": "0x1234...abcd", "name": "my-research-agent"}'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
    "wallet_address": "0x1234...abcd",
    "name": "my-research-agent",
    "created_at": "2026-04-10T14:00:00Z"
  }
  ```
</ResponseExample>

## Notes

* Registration is optional — agents can pay without registering
* Registering lets agents have a named profile and be discoverable
* `name` is optional


## OpenAPI

````yaml POST /v1/agents
openapi: 3.1.0
info:
  title: Xenarch Platform
  version: 0.1.0
servers: []
security: []
paths:
  /v1/agents:
    post:
      tags:
        - agents
      summary: Register Agent Endpoint
      description: >-
        Register an agent by wallet address. Idempotent — returns existing if
        already registered.
      operationId: register_agent_endpoint_v1_agents_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentRegisterRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AgentRegisterRequest:
      properties:
        wallet_address:
          type: string
          pattern: ^0x[0-9a-fA-F]{40}$
          title: Wallet Address
        name:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Name
      type: object
      required:
        - wallet_address
      title: AgentRegisterRequest
    AgentResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        wallet_address:
          type: string
          title: Wallet Address
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - wallet_address
        - name
        - created_at
      title: AgentResponse
    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

````