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

# Open an SSH connection to a Coding sandbox

> Mints a single-use ticket for one SSH connection to a Coding sandbox. Most people use the CLI instead (`singularity sandbox ssh-config`, from CLI 0.6.0), which runs this as ssh's ProxyCommand so ssh, scp, sftp, port forwarding and VS Code / Cursor Remote-SSH work.

The ticket is bound to the public key you send: the sandbox starts an SSH server for this one connection that accepts only that key, and logs you in as the sandbox user (`user` in the answer). No passwords. Open `wss://compute.x402layer.cc` + `path` within `ttl_seconds` (60); the ticket works once. Binary frames carry the SSH byte stream both ways.

A sandbox made before SSH existed answers `409` with code `ssh_setting_up` and `retry_after_seconds` the first time: SSH is being set up on it (about a minute, once). A sleeping sandbox wakes. An open connection keeps it awake (awake hours count as usual).

Auth: a compute API key (`X-API-Key`) with `pods:control:write`, or a wallet signature, same as `/compute/*`. Keys from a Google, GitHub or X login work here.



## OpenAPI

````yaml POST /pods/{id}/coding/ssh
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:
  /pods/{id}/coding/ssh:
    servers:
      - url: https://compute.x402layer.cc
    post:
      tags:
        - Agent Pods
      summary: Open an SSH connection to a Coding sandbox
      description: >-
        Mints a single-use ticket for one SSH connection to a Coding sandbox.
        Most people use the CLI instead (`singularity sandbox ssh-config`, from
        CLI 0.6.0), which runs this as ssh's ProxyCommand so ssh, scp, sftp,
        port forwarding and VS Code / Cursor Remote-SSH work.


        The ticket is bound to the public key you send: the sandbox starts an
        SSH server for this one connection that accepts only that key, and logs
        you in as the sandbox user (`user` in the answer). No passwords. Open
        `wss://compute.x402layer.cc` + `path` within `ttl_seconds` (60); the
        ticket works once. Binary frames carry the SSH byte stream both ways.


        A sandbox made before SSH existed answers `409` with code
        `ssh_setting_up` and `retry_after_seconds` the first time: SSH is being
        set up on it (about a minute, once). A sleeping sandbox wakes. An open
        connection keeps it awake (awake hours count as usual).


        Auth: a compute API key (`X-API-Key`) with `pods:control:write`, or a
        wallet signature, same as `/compute/*`. Keys from a Google, GitHub or X
        login work here.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Coding sandbox (pod) id.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - public_key
              properties:
                public_key:
                  type: string
                  description: >-
                    One OpenSSH public key line: ed25519, ECDSA, a security key
                    (sk-...), or RSA of 2048 bits or more.
                  example: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA... me@laptop
      responses:
        '200':
          description: Ticket issued.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ticket:
                    type: string
                    description: Single-use ticket.
                  ttl_seconds:
                    type: integer
                    example: 60
                  path:
                    type: string
                    example: /pods/screen/<ticket>
                    description: >-
                      Append to wss://compute.x402layer.cc to open the SSH
                      stream.
                  user:
                    type: string
                    example: node
                    description: The user you log in as.
        '400':
          description: No public key, or not an accepted key type.
        '401':
          description: Missing or invalid credential.
        '403':
          description: The key lacks pods:control:write.
        '404':
          description: Not a Coding sandbox on this account.
        '409':
          description: >-
            `ssh_setting_up` (wait `retry_after_seconds`, then ask again),
            `waking`, or `not_available`.
        '429':
          description: Too many connections at once.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.