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

# Launch an agent in the Lucid verified network

> Launch an agent via one of two modes:
- **image**: Deploy a pre-built Docker image (Path A — Bring Your Own Image).
- **base-runtime**: Deploy a pre-configured base runtime with model, prompt, and optional tools (Path B — No-Code).

Both modes create a passport, deploy to the target provider, and inject Lucid env vars.
Returns the passport_id, deployment_id, and deployment URL.




## OpenAPI

````yaml /openapi-spec.yaml post /v1/agents/launch
openapi: 3.0.3
info:
  title: LucidLayer API
  version: 1.0.0
  description: >
    LucidLayer API — the verifiable AI execution layer.


    Blockchain-anchored infrastructure giving AI assets (models, agents, tools,
    compute, datasets)

    provable identity, cryptographic receipts, and reputation backed by real
    traffic data.


    **Open-source and self-hostable.** Run your own instance with `docker
    compose up`

    or `npm start` (port 3001). The SDK defaults to `http://localhost:3001` — no
    cloud

    account required.


    This OpenAPI spec is the source of truth for all backend routes and is used
    to

    generate SDK clients via [Speakeasy](https://speakeasy.com).


    ## Version Strategy


    | Prefix | Status | Description |

    |--------|--------|-------------|

    | `/v1/*` | **Stable** | Core API — passports, receipts, epochs, payouts,
    inference, agent deployment. Production-ready and covered by semver
    guarantees. |

    | `/v2/*` | **Stable** | Cross-chain and reputation APIs — EVM multi-chain,
    ERC-8004, pluggable reputation. Production-ready. |

    | `/api/agents/*` | **Deprecated** | Legacy agent MMR orchestration.
    Retained for SDK backward compatibility only. Migrate to `/v1/agents/*`
    (AgentDeploy, AgentMirror). Will be removed in a future major version. |

    | `/health/*` | **Stable** | System health probes — not versioned
    (infrastructure endpoints). |


    ### Migration Path (legacy `/api/agents/*` to `/v1/agents/*`)


    1. Replace `init_agent` + `process_agent_epoch` with `lucid_deploy_agent`
    (one-click deployment).

    2. Replace `generate_agent_proof` with `lucid_get_agent_proof` /
    `lucid_get_agent_run_proof` (AgentMirror).

    3. Replace `get_agent_stats` / `get_agent_history` with
    `lucid_get_agent_receipts` + `lucid_get_agent_epoch`.

    4. All legacy operationIds will be removed when the next major version
    ships.


    ## Route Groups


    - `/v1/*` — Passports, Match, Run, Receipts, Epochs, Payouts, Compute

    - `/v1/agents/*` — Agent Deployment, Wallet, Revenue, Mirror
    (receipts/proofs)

    - `/v1/a2a/*` — A2A Protocol (Agent-to-Agent)

    - `/v1/config/*` — Payment configuration and grants

    - `/v2/chains/*` — Cross-chain status and routing

    - `/v2/agents/*` — ERC-8004 agent registration and reputation

    - `/v2/reputation/*` — Pluggable reputation scoring, cross-chain aggregation

    - `/v2/payouts/*` — On-chain payout execution

    - `/health/*` — System health and dependency checks

    - `/api/agents/*` — Legacy agent MMR orchestration (deprecated)
servers:
  - url: http://localhost:3001
    description: Local / self-hosted (default for open-source users)
    x-speakeasy-server-id: local
  - url: https://{host}:{port}
    description: Self-hosted instance (custom host and port)
    x-speakeasy-server-id: self-hosted
    variables:
      host:
        default: localhost
        description: Hostname or IP of your Lucid instance
      port:
        default: '3001'
        description: Port your Lucid instance listens on
  - url: https://api.lucid.foundation
    description: Managed cloud (Raijin Labs hosted)
    x-speakeasy-server-id: cloud
security:
  - BearerAuth: []
  - {}
tags:
  - name: Passports
    description: >-
      AI asset identity — create, list, update, delete
      model/compute/tool/dataset/agent passports
  - name: Match
    description: Policy-based compute matching and route planning
  - name: Run
    description: OpenAI-compatible inference (chat completions) and model listing
  - name: Receipts
    description: Cryptographic receipts — create, verify, and generate MMR inclusion proofs
  - name: Epochs
    description: Epoch lifecycle — creation, finalization, on-chain anchoring, and retry
  - name: Payouts
    description: Revenue split calculation and payout execution (basis-point math)
  - name: Compute
    description: Compute node heartbeat registration and health monitoring
  - name: Health
    description: System health — liveness, readiness, and per-dependency status checks
  - name: Agents
    description: >-
      DEPRECATED: Legacy agent MMR orchestration (use AgentDeploy, AgentMirror
      instead)
  - name: Shares
    description: Share token launch and revenue airdrop for fractional AI asset ownership
  - name: Escrow
    description: Cross-chain escrow lifecycle — create, release, dispute, and query
  - name: Disputes
    description: Escrow dispute resolution — open, submit evidence, resolve, appeal
  - name: Paymaster
    description: >-
      ERC-4337 gas sponsorship — sponsor transactions, estimate fees, check
      rates
  - name: Identity
    description: >-
      Cross-chain identity bridging — CAIP-10 linking, resolution, and chain
      discovery
  - name: TBA
    description: ERC-6551 Token Bound Accounts — create and query agent wallets
  - name: Modules
    description: >-
      ERC-7579 module management — install, uninstall, and configure
      policy/payout modules
  - name: zkML
    description: >-
      Zero-knowledge ML — prove inference, verify proofs, register models
      on-chain
  - name: Payments
    description: >-
      x402 payment configuration — pricing, facilitators, grants, and
      subscription
  - name: AgentDeploy
    description: >-
      Agent deployment lifecycle — deploy, status, logs, scale, terminate across
      6 targets
  - name: AgentWallet
    description: Agent PDA wallet — balance, send, policy limits, and transaction history
  - name: AgentRevenue
    description: >-
      Agent revenue pools — earnings tracking, airdrop triggers, and pool
      queries
  - name: A2A
    description: Google A2A protocol — agent cards, task submission, and task lifecycle
  - name: Reputation
    description: >-
      Pluggable reputation scoring — algorithms, compute scores, and composite
      aggregation
  - name: CrossChain
    description: >-
      EVM multi-chain operations — chain status, ERC-8004 registration,
      cross-chain reputation and payouts
  - name: AgentMirror
    description: >-
      Read-only agent proof endpoints — receipts, epochs, and MMR proofs (admin
      auth required)
  - name: Memory
    description: >-
      Agent memory — episodic, semantic, procedural, entity, trust-weighted,
      temporal types with hash-chain provenance
  - name: Anchoring
    description: >-
      DePIN anchoring control plane — query, verify, and trace artifact anchor
      records
  - name: AgentLaunch
    description: >-
      Agent activation — launch via image or base runtime, blue-green rollout,
      promotion, and rollback
  - name: Webhooks
    description: >-
      Deployment webhook receivers — normalizes provider-specific callbacks into
      deployment events
paths:
  /v1/agents/launch:
    post:
      tags:
        - AgentLaunch
      summary: Launch an agent in the Lucid verified network
      description: >
        Launch an agent via one of two modes:

        - **image**: Deploy a pre-built Docker image (Path A — Bring Your Own
        Image).

        - **base-runtime**: Deploy a pre-configured base runtime with model,
        prompt, and optional tools (Path B — No-Code).


        Both modes create a passport, deploy to the target provider, and inject
        Lucid env vars.

        Returns the passport_id, deployment_id, and deployment URL.
      operationId: lucid_launch_agent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/LaunchImageRequest'
                - $ref: '#/components/schemas/LaunchBaseRuntimeRequest'
              discriminator:
                propertyName: mode
                mapping:
                  image:
                    $ref: '#/components/schemas/LaunchImageRequest'
                  base-runtime:
                    $ref: '#/components/schemas/LaunchBaseRuntimeRequest'
            examples:
              image_mode:
                summary: Launch with a Docker image
                value:
                  mode: image
                  image: ghcr.io/myorg/my-agent:latest
                  target: railway
                  owner: 7xK9mQ2vNbPfYkRd3JhEzV1LnWqA8tUcGp4SyDfH5Bo
                  name: my-trading-agent
              base_runtime_mode:
                summary: Launch with base runtime
                value:
                  mode: base-runtime
                  model: gpt-4o
                  prompt: You are a helpful trading assistant
                  target: docker
                  owner: 7xK9mQ2vNbPfYkRd3JhEzV1LnWqA8tUcGp4SyDfH5Bo
                  name: trading-assistant
      responses:
        '201':
          description: Agent launched
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LaunchResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";

            const raijinLabsLucidAi = new RaijinLabsLucidAi({
              bearerAuth: process.env["RAIJINLABSLUCIDAI_BEARER_AUTH"] ?? "",
            });

            async function run() {
              const result = await raijinLabsLucidAi.agents.launch.lucidLaunchAgent({
                mode: "image",
                image: "ghcr.io/myorg/my-agent:latest",
                target: "railway",
                owner: "7xK9mQ2vNbPfYkRd3JhEzV1LnWqA8tUcGp4SyDfH5Bo",
                name: "my-trading-agent",
                verification: "full",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    LaunchImageRequest:
      type: object
      required:
        - mode
        - image
        - target
        - owner
        - name
      properties:
        mode:
          type: string
          enum:
            - image
          description: Launch mode — bring your own Docker image
        image:
          type: string
          description: Docker image reference (e.g. ghcr.io/myorg/my-agent:latest)
        target:
          type: string
          enum:
            - docker
            - railway
            - akash
            - phala
            - ionet
            - nosana
          description: Deployment target provider
        owner:
          type: string
          description: Owner wallet address (Solana base58 or EVM 0x)
        name:
          type: string
          description: Human-readable agent name
        port:
          type: integer
          description: Container port to expose (default 8080)
        verification:
          type: string
          enum:
            - full
            - minimal
          default: full
          description: Verification mode (full includes receipts + memory + payment hooks)
        env_vars:
          type: object
          additionalProperties:
            type: string
          description: Additional environment variables injected into the container
        registry_auth:
          type: object
          properties:
            username:
              type: string
            password:
              type: string
          description: >-
            Private registry credentials (never stored, used at deploy time
            only)
    LaunchBaseRuntimeRequest:
      type: object
      required:
        - mode
        - model
        - prompt
        - target
        - owner
        - name
      properties:
        mode:
          type: string
          enum:
            - base-runtime
          description: Launch mode — pre-built base runtime
        model:
          type: string
          description: Model identifier (e.g. gpt-4o, claude-3-opus)
        prompt:
          type: string
          description: System prompt for the agent
        target:
          type: string
          enum:
            - docker
            - railway
            - akash
            - phala
            - ionet
            - nosana
          description: Deployment target provider
        owner:
          type: string
          description: Owner wallet address (Solana base58 or EVM 0x)
        name:
          type: string
          description: Human-readable agent name
        tools:
          type: array
          items:
            type: string
          description: Optional tool identifiers to enable
    LaunchResponse:
      type: object
      required:
        - success
        - reputation_eligible
      properties:
        success:
          type: boolean
        passport_id:
          type: string
          description: Created passport identifier
        deployment_id:
          type: string
          description: Deployment record identifier
        deployment_url:
          type: string
          description: Public URL of the deployed agent
        verification_mode:
          type: string
          enum:
            - full
            - minimal
          description: Active verification mode
        reputation_eligible:
          type: boolean
          description: Whether the agent is eligible for on-chain reputation scoring
        config_hash:
          type: string
          description: SHA-256 hash of the launch configuration (for audit)
        error:
          type: string
          description: Error message (present only when success is false)
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
        error:
          type: string
        message:
          type: string
        error_code:
          type: string
        details: {}
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Lucid API key (lk_live_... or lk_test_...)

````