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

# Provision a compute instance

> Returns x402 and MPP 402 payment challenges when no payment credential is supplied, or provisions a Vultr or DigitalOcean instance after x402 or MPP payment settlement.



## OpenAPI

````yaml /api-reference/openapi.json post /compute/provision
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.
  - name: Agent Pods API
    description: >-
      The programmatic `/pods/v1` surface: create, drive and destroy Agent Pods
      with a single `X-API-Key`. Distinct from the Agent Pods dashboard routes,
      which expect a wallet signature or a browser session.
paths:
  /compute/provision:
    servers:
      - url: https://compute.x402layer.cc
    post:
      tags:
        - Compute Instances
      summary: Provision a compute instance
      description: >-
        Returns x402 and MPP 402 payment challenges when no payment credential
        is supplied, or provisions a Vultr or DigitalOcean instance after x402
        or MPP payment settlement.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                plan:
                  type: string
                region:
                  type: string
                os_id:
                  type: integer
                label:
                  type: string
                hostname:
                  type: string
                prepaid_hours:
                  type: integer
                  minimum: 24
                  description: >-
                    Prepaid runtime in hours (minimum 24). Provision uses
                    prepaid_hours; the extend endpoint uses extend_hours.
                use_credits:
                  type: boolean
                  description: >-
                    Pay from prepaid USD credits instead of an x402 wallet
                    payment. Supported for bare and grid machines. NOT supported
                    for ai_machine (private AI Machines require an x402 wallet
                    payment).
                provider:
                  type: string
                  enum:
                    - vultr
                    - digitalocean
                  description: >-
                    Optional provider hint. Plan IDs with do: prefix resolve to
                    DigitalOcean.
                network:
                  type: string
                  enum:
                    - base
                    - solana
                    - megaeth
                    - robinhood
                  description: >-
                    x402 payment network. Robinhood Chain settles in USDG; Base
                    and MegaETH settle in USDC; Solana settles in USDC. MPP
                    clients use Authorization: Payment and do not need this
                    field.
                ssh_public_key:
                  type: string
                user_data:
                  type: string
                  description: Optional cloud-init user data run at first boot.
                ai_machine:
                  type: object
                  description: >-
                    Private AI Machine (Standard tier). When present, the
                    machine self-installs the pinned LLM behind your own
                    OpenAI-compatible endpoint (URL + API key), running
                    llama-server (llama.cpp) on port 8080 exposing /v1
                    (/v1/chat/completions and /v1/models). Supports x402, MPP,
                    or prepaid credits. Mutually exclusive with deploy_node.
                  properties:
                    model_id:
                      type: string
                      description: The LLM to serve on the instance.
                    mode:
                      type: string
                      enum:
                        - private
                      description: Must be 'private'.
                  required:
                    - model_id
                    - mode
                deploy_node:
                  type: object
                  description: >-
                    Join the grid. When present, the machine self-installs as a
                    network node owned by the paying wallet, earning USDC + SGL
                    (requires 50,000 SGL staked). Requires an x402 Solana
                    payment. Mutually exclusive with ai_machine.
                  properties:
                    model_id:
                      type: string
                      description: The LLM the node will serve on the grid.
                    tee_type:
                      type: string
                      description: Optional TEE type for the node deploy.
                  required:
                    - model_id
              required:
                - plan
                - region
                - os_id
      responses:
        '201':
          description: Provisioning started
        '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'
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

````