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

# Turn on SSH

> Save your public key and turn on Direct SSH for a Linux computer.

Saves your public key and turns on [Direct SSH](/guides/ssh.md). Call it again with new keys to update them: the keys you send replace the keys on the computer. If the answer asks for a restart, the old keys keep working until the computer restarts.

Send the **public** key only (the contents of a `.pub` file). To allow more than one key, put one per line.

When the answer says `requires_restart: true`, the key could not be put on the running computer yet. Restart the computer once and it is in place.

Then read [Get SSH settings](/api-reference/computers/ssh-get.md) for the command to connect.

Linux computers only. Owners and editors of the workspace only; view only members and share link guests are refused.


## OpenAPI

````yaml POST /computers/{id}/ssh
openapi: 3.1.0
info:
  title: Orgo API
  description: >-
    Launch cloud computers that AI agents can control and interact with. Create
    workspaces, provision computers, and control them programmatically.
  version: 2.0.0
  contact:
    name: Orgo Support
    email: spencer@orgo.ai
    url: https://orgo.ai
servers:
  - url: https://www.orgo.ai/api
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Support
    description: >-
      Orgo’s support agent, for programs: ask how to do something in Orgo and
      get an answer with full URLs and copyable commands.
  - name: Account
    description: >-
      Account capacity: how many computers an account may run, and adding or
      giving back more.
  - name: Agent accounts
    description: >-
      Accounts an AI agent makes for itself, and the claim link a person uses to
      take one over.
  - name: Clients
    description: >-
      Run Orgo for your clients from your own app: a workspace and scoped key
      each, billed to you or to them.
  - name: Workspaces
    description: Organize computers into named workspaces
  - name: Computers
    description: Provision and manage virtual computers
  - name: Computer Lifecycle
    description: Start, stop, and restart computers
  - name: Computer Actions
    description: Control mouse, keyboard, and execute commands
  - name: Screens
    description: >-
      More than one desktop on a single computer. Each screen is its own X
      server with its own cursor and window manager, so an agent working on one
      cannot disturb another.
  - name: Files
    description: Upload and download files
  - name: Templates
    description: Author, build, and launch reproducible computers from templates
  - name: Chat
    description: Run an agent on a computer through OpenAI-compatible chat completions.
paths:
  /computers/{id}/ssh:
    post:
      tags:
        - Computers
      summary: Turn on SSH
      description: >-
        Saves your public key and turns Direct SSH on (or updates the key). The
        keys you send replace the keys on the computer; if the answer asks for a
        restart, the old keys keep working until the computer restarts. Linux
        computers only. Owners and editors only.
      operationId: enableComputerSsh
      parameters:
        - name: id
          in: path
          required: true
          description: Computer ID. Accepts the computer's UUID or its `instance_id`.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - public_key
              properties:
                public_key:
                  type: string
                  description: >-
                    One or more OpenSSH public keys, one per line, 16 KB at
                    most: `ssh-ed25519`, `ssh-rsa`, `ecdsa-sha2-*`,
                    `sk-ssh-ed25519@openssh.com` or
                    `sk-ecdsa-sha2-*@openssh.com`. Never a private key.
            example:
              public_key: >-
                ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyOnlyForDocs
                you@laptop
      responses:
        '200':
          description: Saved
          content:
            application/json:
              schema:
                type: object
                properties:
                  enabled:
                    type: boolean
                  authorized_key_set:
                    type: boolean
                  ssh_host_port:
                    type:
                      - integer
                      - 'null'
                    description: The computer's SSH port, when the server reported it.
                  pending:
                    type: boolean
                    description: >-
                      True when the key could not be put on the running computer
                      yet. It lands on the next start.
                  requires_restart:
                    type: boolean
                    description: >-
                      Same as `pending`: restart the computer once to use the
                      key.
              example:
                enabled: true
                authorized_key_set: true
                ssh_host_port: 20314
                pending: false
                requires_restart: false
        '400':
          description: >-
            The computer isn't Linux, or `public_key` is missing, empty, larger
            than 16 KB, or not a valid public key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                os:
                  summary: Not Linux
                  value:
                    error: Direct SSH isn’t supported on Windows computers.
                    code: SSH_UNSUPPORTED_OS
                key:
                  summary: Not a public key
                  value:
                    error: >-
                      Not a valid SSH public key: "-----BEGIN OPENSSH PRIVATE
                      KEY-----"…
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/TrialInactive'
        '403':
          description: >-
            A share link guest, a view only member, someone outside the
            computer's workspace, or an API key scoped to another workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                view-only:
                  summary: View only member
                  value:
                    error: >-
                      This workspace is view-only. Ask the owner for write
                      access (workspace_read_only).
                no-access:
                  summary: Not in the workspace
                  value:
                    error: You do not have access to this workspace.
                scoped-key:
                  summary: Key for another workspace
                  value:
                    error: >-
                      This API key cannot access this workspace
                      (workspace_scope_mismatch).
                guest:
                  summary: Share link guest
                  value:
                    error: Sign up to create your own workspace.
                    code: GUEST_RESTRICTED
        '404':
          description: No computer with this ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Desktop not found
        '500':
          description: Saving failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Failed to set SSH
        '503':
          $ref: '#/components/responses/AuthUnavailable'
components:
  schemas:
    Error:
      type: object
      description: >-
        The base error body. Every failure carries `error`; individual endpoints
        add the fields named in the schemas below.
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable message.
          example: Access denied
        code:
          type: string
          description: >-
            Machine-readable reason. Present on the failures that define one,
            absent otherwise.
  responses:
    Unauthorized:
      description: 'No usable credential. Send `Authorization: Bearer $ORGO_API_KEY`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalid-key:
              summary: The key is not one of yours
              value:
                error: Invalid API key
            no-credential:
              summary: No key and no session
              value:
                error: Authentication required
    TrialInactive:
      description: >-
        The computer is a free trial computer whose trial is no longer active,
        or it is paid for by its own subscription or dedicated purchase and that
        payment has lapsed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            trial:
              summary: Trial no longer active
              value:
                error: Choose a plan to continue.
            payment:
              summary: The computer's own payment has lapsed
              value:
                error: Manage this computer’s payment in Account → Usage.
    AuthUnavailable:
      description: >-
        Orgo could not verify the credential because of a server-side fault,
        such as a database outage. Retry after `Retry-After`. Do not rotate the
        key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: >-
              Service temporarily unavailable. The database is not accepting
              requests. Retry shortly.
      headers:
        Retry-After:
          description: Seconds to wait before retrying. Always `5`.
          schema:
            type: string
            example: '5'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key authentication. Get your key at orgo.ai/workspaces

````

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