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

# Deploy an Agent Pod

> Deploys a hosted agent. The paid deploy rides the audited `/compute/provision` money path, so payment works exactly like provisioning a machine: pay from prepaid credits (`use_credits: true`) or complete an x402/MPP payment (a `402` challenge is returned when no payment credential is supplied). All `/compute/provision` fields (`plan`, `region`, `prepaid_hours`, `network`, `ssh_public_key`, ...) are accepted alongside the pod-specific fields below; `os_id` is ignored (pods always run Ubuntu 24.04). Authenticate with the same compute auth as `/compute/*` (API key, session bearer, or wallet signature).



## OpenAPI

````yaml POST /pods
openapi: 3.1.0
info:
  title: x402 Singularity Layer API
  description: >-
    OpenAPI-backed reference for marketplace discovery, payment routes,
    webhooks, wallet-first auth, agent endpoints, and ERC-8004 flows.
  version: 1.0.0
servers:
  - url: https://api.x402layer.cc
security: []
tags:
  - name: Marketplace
    description: Public discovery and listing lookup
  - name: Public Endpoints
    description: Public endpoint metadata and hosted checkout context
  - name: Public Payment Links
    description: Hosted public payment-link lookup
  - name: Payments
    description: Hosted x402 payment challenge routes
  - name: Receipts
    description: Signed receipt lookup and verification helpers
  - name: Ratings
    description: Public listing ratings and authenticated rating actions
  - name: Webhooks
    description: Seller webhook management API
  - name: Agent Auth
    description: Wallet-first challenge and verification routes
  - name: Agent Endpoints
    description: Create, read, top up, and delete agent endpoints
  - name: ERC-8004
    description: Agent registry and registration lifecycle routes
  - name: Marketplace Agents
    description: Public ERC-8004 marketplace discovery routes
  - name: Compute Catalog
    description: Compute plans, regions, and OS catalog
  - name: Compute Instances
    description: Provision, inspect, extend, and destroy compute instances
  - name: Compute API Keys
    description: API keys for compute agent access
  - name: Fundraiser Campaigns
    description: List, view, create, and edit fundraiser campaigns
  - name: Fundraiser Contributions
    description: Record and list campaign contributions
  - name: Fundraiser Comments
    description: Campaign comment threads
  - name: Fundraiser Media
    description: Campaign image uploads and OG images
  - name: Enterprise
    description: >-
      Enterprise partner configuration, endpoint listing, revenue stats, and
      transaction ledger
  - name: Staking
    description: Agentic $SGL staking
  - name: SGL Grid
    description: >-
      Decentralized, confidential, OpenAI-compatible inference served by
      attested TEE nodes.
  - name: Compute Credits
    description: Prepaid USDC credit balance shared across Machines and Grid.
  - name: Agent Pods
    description: >-
      Deploy and manage hosted agents (Agent Pods), plus the pod's
      OpenAI-compatible adapter for external clients.
paths:
  /pods:
    servers:
      - url: https://compute.x402layer.cc
    post:
      tags:
        - Agent Pods
      summary: Deploy an Agent Pod
      description: >-
        Deploys a hosted agent. The paid deploy rides the audited
        `/compute/provision` money path, so payment works exactly like
        provisioning a machine: pay from prepaid credits (`use_credits: true`)
        or complete an x402/MPP payment (a `402` challenge is returned when no
        payment credential is supplied). All `/compute/provision` fields
        (`plan`, `region`, `prepaid_hours`, `network`, `ssh_public_key`, ...)
        are accepted alongside the pod-specific fields below; `os_id` is ignored
        (pods always run Ubuntu 24.04). Authenticate with the same compute auth
        as `/compute/*` (API key, session bearer, or wallet signature).
      parameters:
        - name: X-API-Key
          in: header
          required: false
          schema:
            type: string
            example: x402c_...
          description: >-
            Compute API key. Alternatively use a session bearer or
            wallet-signature headers.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - agent_id
                - ai_mode
                - plan
                - region
              properties:
                agent_id:
                  type: string
                  example: openclaw
                  description: Agent to deploy (see `GET /pods/catalog`).
                ai_mode:
                  type: string
                  enum:
                    - managed
                    - byok
                  description: >-
                    `managed` = we run the LLM (metered, tier-driven). `byok` =
                    the agent uses your own OpenAI-compatible endpoint.
                tier:
                  type: string
                  example: starter
                  description: >-
                    Required when `ai_mode` is `managed`. A tier id from `GET
                    /pods/catalog` (drives the model + machine floor).
                model:
                  type: string
                  description: >-
                    Optional model slug. Managed: honored only if it is in the
                    chosen tier's list, else the tier default. BYOK: any slug.
                plan:
                  type: string
                  description: >-
                    Compute plan id from `GET /compute/plans`. DigitalOcean
                    plans use the `do:` prefix.
                region:
                  type: string
                  description: Region id from `GET /compute/regions`.
                plan_ram_mb:
                  type: integer
                  description: >-
                    Optional. Validated against the agent's (and tier's) RAM
                    floor.
                use_credits:
                  type: boolean
                  description: >-
                    Pay from prepaid USD credits instead of an x402 wallet
                    payment.
                network:
                  type: string
                  enum:
                    - base
                    - solana
                    - megaeth
                    - robinhood
                  description: >-
                    x402 payment network. MPP clients use `Authorization:
                    Payment` and omit this.
                prepaid_hours:
                  type: integer
                  minimum: 24
                  description: Prepaid runtime in hours (minimum 24).
                llm_api_key:
                  type: string
                  description: >-
                    Required when `ai_mode` is `byok`. Your provider API key
                    (stored encrypted).
                llm_base_url:
                  type: string
                  description: >-
                    BYOK only. Your OpenAI-compatible base URL. Defaults to
                    `https://openrouter.ai/api/v1`.
                llm_api:
                  type: string
                  description: BYOK only. Provider API type (e.g. `openai-completions`).
                channels:
                  type: object
                  description: >-
                    Optional channel tokens, keyed by channel id (e.g. `{
                    "telegram": "<bot-token>" }`). Must be supported by the
                    agent.
                  additionalProperties:
                    type: string
                memory:
                  type: object
                  description: BYOK memory options.
                  properties:
                    backend:
                      type: string
                      enum:
                        - raw
                        - mem0
                    api_key:
                      type: string
                      description: Your mem0 key when `backend` is `mem0`.
                    lcm:
                      type: boolean
                ssh_public_key:
                  type: string
                  description: Optional. Rarely needed — pods are headless.
      responses:
        '200':
          description: >-
            Pod deployed. Returns the provision result (including `order`)
            merged with a `pod` object. For managed pods, `pod.managed_ai_key`
            is shown ONCE.
          content:
            application/json:
              schema:
                type: object
                properties:
                  order:
                    type: object
                    description: The underlying compute order (from `/compute/provision`).
                  pod:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: Pod id (equals the compute order id).
                      agent_id:
                        type: string
                      display_name:
                        type: string
                      ai_mode:
                        type: string
                        enum:
                          - managed
                          - byok
                      tier:
                        type: string
                        nullable: true
                      model:
                        type: string
                        nullable: true
                      channels:
                        type: array
                        items:
                          type: string
                      managed_ai_key:
                        type: string
                        description: >-
                          Managed pods only. The pod's key for our managed LLM
                          proxy. Shown once.
                      managed_ai_key_note:
                        type: string
        '400':
          description: >-
            Invalid body (unknown agent, bad `ai_mode`, missing `tier`, machine
            too small, ...)
        '402':
          description: >-
            Payment required. x402 clients use the JSON body; MPP clients use
            the `WWW-Authenticate: Payment` header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/X402Challenge'
        '409':
          description: Agent is coming soon and can't be deployed yet.
        '503':
          description: Feature not configured (e.g. managed AI or pod secrets disabled).
components:
  schemas:
    X402Challenge:
      type: object
      properties:
        x402Version:
          type: integer
        accepts:
          type: array
          items:
            type: object
            properties:
              scheme:
                type: string
              network:
                type: string
              maxAmountRequired:
                type: string
              resource:
                type: string
              description:
                type: string
              payTo:
                type: string
              asset:
                type: string
        api_schema:
          $ref: '#/components/schemas/ApiSchema'
          description: >-
            When present, describes the API routes, parameters, and request
            bodies the endpoint accepts. Agents can use this to self-discover
            how to call the API after payment.
    ApiSchema:
      type: object
      description: >-
        Describes the routes, parameters, and request bodies an endpoint
        accepts. Attached to endpoints during creation and returned in 402
        challenges, marketplace listings, and public endpoint metadata.
      properties:
        version:
          type: integer
          enum:
            - 1
        baseUrl:
          type: string
          format: uri
          description: Optional base URL override for the API
        routes:
          type: array
          items:
            $ref: '#/components/schemas/ApiSchemaRoute'
    ApiSchemaRoute:
      type: object
      description: >-
        A single API route with its method, path, parameters, and optional
        request body
      properties:
        path:
          type: string
          example: /users/{id}
          description: Route path with optional path parameters in curly braces
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - PATCH
            - DELETE
        summary:
          type: string
          description: Human-readable name shown to consumers on the payment page
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/ApiSchemaParam'
        requestBody:
          $ref: '#/components/schemas/ApiSchemaBody'
        responseExample:
          type: string
          description: Example response JSON string
    ApiSchemaParam:
      type: object
      properties:
        name:
          type: string
          description: Parameter identifier
        in:
          type: string
          enum:
            - query
            - path
            - header
        type:
          type: string
          enum:
            - string
            - number
            - boolean
            - array
            - object
        required:
          type: boolean
        description:
          type: string
          description: Human-readable label shown to consumers
        example:
          type: string
          description: Placeholder text shown in the input field
    ApiSchemaBody:
      type: object
      properties:
        contentType:
          type: string
          enum:
            - application/json
            - multipart/form-data
            - text/plain
        fields:
          type: array
          items:
            $ref: '#/components/schemas/ApiSchemaParam'
        example:
          type: string
          description: Default body content shown as placeholder

````