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

# Add Compute SSH Key

> Add an SSH public key at /api/v1/compute/reservations/{id}/ssh-keys

## Overview

Adds a public key to every node of a reservation; the write behind `morph compute keys add`. The key is returned as `applying`. Added before the nodes are handed over, it goes on with the handover.

Organization keys require an organization admin.


## OpenAPI

````yaml POST /api/v1/compute/reservations/{id}/ssh-keys
openapi: 3.1.0
info:
  title: Morph API
  version: 1.2.0
  description: >-
    The Morph public API at api.morphllm.com: OpenAI- and Anthropic-compatible
    inference (chat completions, messages), Fast Apply code editing, Compact
    context compression, System One typed decisions, speech to text (audio
    transcription and translation), model listing, and dedicated endpoint
    management, agentic credit top-ups paid over x402, account usage and billing
    settings, and organization member budgets. Model ids, prices, and context
    windows are served live at https://www.morphllm.com/api/models/json.
  contact:
    name: Morph
    url: https://morphllm.com
    email: info@morphllm.com
  license:
    name: Proprietary
    url: https://morphllm.com/privacy/tos
servers:
  - url: https://api.morphllm.com
    description: Production
security: []
tags:
  - name: chat
    description: >-
      OpenAI- and Anthropic-compatible chat inference, including Fast Apply and
      WarpGrep models.
  - name: compact
    description: Context compression for long agent conversations.
  - name: systemone
    description: 'Typed decisions: a state in, a probability distribution per question out.'
  - name: audio
    description: >-
      Speech to text: transcription and translation of audio files,
      OpenAI-compatible.
  - name: models
    description: Model listing.
  - name: dedicated
    description: Dedicated endpoint discovery, status, and cancellation.
  - name: compute
    description: >-
      Dedicated compute: reserve whole GPU nodes by the month, manage SSH keys,
      give notice. Limited preview.
  - name: credits
    description: Agentic credit top-ups paid in USDC over x402.
  - name: account
    description: >-
      Usage and spend per day; billing settings: extra usage, spend limit and
      alert, auto-reload.
  - name: organization
    description: Organization member budgets.
  - name: telemetry
    description: Usage reporting hooks.
paths:
  /api/v1/compute/reservations/{id}/ssh-keys:
    post:
      tags:
        - compute
      summary: Add an SSH key to a reservation
      description: >-
        Puts a public key on every node of the reservation. Before the nodes are
        handed over the key is stored and goes on with the handover. A
        reservation holds up to 50 keys. Requires an organization admin.
      operationId: addComputeSshKey
      parameters:
        - schema:
            type: string
            format: uuid
            description: Id of the reservation to add the key to.
            example: b81f2c40-7d9e-4a35-9c16-3f5a8e0d2b74
          required: true
          description: Identifies the reservation that gets the key.
          name: id
          in: path
      requestBody:
        description: The key and a name for it.
        content:
          application/json:
            example:
              name: laptop
              publicKey: >-
                ssh-ed25519
                AAAAC3NzaC1lZDI1NTE5AAAAIHk0m2pQd6v1ZxW3c8rT5uYbN7aLfJ9sKqE4oVgXhC2D
                you@laptop
            schema:
              $ref: '#/components/schemas/ComputeSshKeyBody'
      responses:
        '201':
          description: Key recorded as `applying`.
          content:
            application/json:
              example:
                sshKey:
                  id: e47a9d13-2c58-4b06-8f31-6a0d5c9e7b28
                  name: laptop
                  fingerprint: SHA256:Qm3nVx0aT7cJ1yKd5uE8rLw2bH6sZf9oP4gNiC0tXeA
                  publicKey: >-
                    ssh-ed25519
                    AAAAC3NzaC1lZDI1NTE5AAAAIHk0m2pQd6v1ZxW3c8rT5uYbN7aLfJ9sKqE4oVgXhC2D
                    you@laptop
                  state: applying
                  error: null
                  createdAt: '2027-01-04T09:14:00.000Z'
              schema:
                $ref: '#/components/schemas/ComputeSshKeyResult'
        '400':
          description: >-
            The name is empty or too long, or `publicKey` is not one SSH public
            key.
          content:
            application/json:
              example:
                error: Give the key a name of up to 64 characters
              schema:
                $ref: '#/components/schemas/ComputeError'
        '401':
          $ref: '#/components/responses/ComputeUnauthorized'
        '403':
          $ref: '#/components/responses/ComputeAdminRequired'
        '404':
          $ref: '#/components/responses/ComputeNotFound'
        '409':
          description: >-
            The key is already on the reservation, the reservation holds 50
            keys, or its keys are not managed here (it has ended, or Morph
            manages access under a contract).
          content:
            application/json:
              example:
                error: That key is already on this cluster
              schema:
                $ref: '#/components/schemas/ComputeError'
      security:
        - bearerAuth: []
components:
  schemas:
    ComputeSshKeyBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 64
          description: A name for the key, up to 64 characters.
          example: laptop
        publicKey:
          type: string
          minLength: 1
          maxLength: 16384
          description: 'One SSH public key: the contents of a `.pub` file.'
          example: >-
            ssh-ed25519
            AAAAC3NzaC1lZDI1NTE5AAAAIHk0m2pQd6v1ZxW3c8rT5uYbN7aLfJ9sKqE4oVgXhC2D
            you@laptop
      required:
        - name
        - publicKey
      description: An SSH public key and its name.
      example:
        name: laptop
        publicKey: >-
          ssh-ed25519
          AAAAC3NzaC1lZDI1NTE5AAAAIHk0m2pQd6v1ZxW3c8rT5uYbN7aLfJ9sKqE4oVgXhC2D
          you@laptop
    ComputeSshKeyResult:
      type: object
      properties:
        sshKey:
          allOf:
            - $ref: '#/components/schemas/ComputeSshKey'
            - description: The key after the change.
              example:
                id: e47a9d13-2c58-4b06-8f31-6a0d5c9e7b28
                name: laptop
                fingerprint: SHA256:Qm3nVx0aT7cJ1yKd5uE8rLw2bH6sZf9oP4gNiC0tXeA
                publicKey: >-
                  ssh-ed25519
                  AAAAC3NzaC1lZDI1NTE5AAAAIHk0m2pQd6v1ZxW3c8rT5uYbN7aLfJ9sKqE4oVgXhC2D
                  you@laptop
                state: applying
                error: null
                createdAt: '2027-01-04T09:14:00.000Z'
      required:
        - sshKey
      description: The key that was added or removed.
      example:
        sshKey:
          id: e47a9d13-2c58-4b06-8f31-6a0d5c9e7b28
          name: laptop
          fingerprint: SHA256:Qm3nVx0aT7cJ1yKd5uE8rLw2bH6sZf9oP4gNiC0tXeA
          publicKey: >-
            ssh-ed25519
            AAAAC3NzaC1lZDI1NTE5AAAAIHk0m2pQd6v1ZxW3c8rT5uYbN7aLfJ9sKqE4oVgXhC2D
            you@laptop
          state: applying
          error: null
          createdAt: '2027-01-04T09:14:00.000Z'
    ComputeError:
      type: object
      properties:
        error:
          type: string
          description: Why the request failed and what to change, as one or two sentences.
          example: >-
            Reservation not found. List yours with GET
            /api/v1/compute/reservations.
      required:
        - error
      description: Error body returned by the compute routes.
      example:
        error: >-
          Reservation not found. List yours with GET
          /api/v1/compute/reservations.
    ComputeSshKey:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Key id. Pass it to the remove route.
          example: e47a9d13-2c58-4b06-8f31-6a0d5c9e7b28
        name:
          type: string
          description: The name given when the key was added.
          example: laptop
        fingerprint:
          type: string
          description: SHA-256 fingerprint of the key.
          example: SHA256:Qm3nVx0aT7cJ1yKd5uE8rLw2bH6sZf9oP4gNiC0tXeA
        publicKey:
          type: string
          description: The public key as stored.
          example: >-
            ssh-ed25519
            AAAAC3NzaC1lZDI1NTE5AAAAIHk0m2pQd6v1ZxW3c8rT5uYbN7aLfJ9sKqE4oVgXhC2D
            you@laptop
        state:
          type: string
          enum:
            - applying
            - active
            - removing
          description: >-
            `applying` until the key is on every node, then `active`. `removing`
            until it is off every node, then it leaves the list.
          example: active
        error:
          type:
            - string
            - 'null'
          description: Why the key could not be applied or removed yet, else null.
          example: null
        createdAt:
          type: string
          format: date-time
          description: ISO 8601 time the key was added.
          example: '2027-01-04T09:14:00.000Z'
      required:
        - id
        - name
        - fingerprint
        - publicKey
        - state
        - error
        - createdAt
      description: One SSH key on a reservation.
      example:
        id: e47a9d13-2c58-4b06-8f31-6a0d5c9e7b28
        name: laptop
        fingerprint: SHA256:Qm3nVx0aT7cJ1yKd5uE8rLw2bH6sZf9oP4gNiC0tXeA
        publicKey: >-
          ssh-ed25519
          AAAAC3NzaC1lZDI1NTE5AAAAIHk0m2pQd6v1ZxW3c8rT5uYbN7aLfJ9sKqE4oVgXhC2D
          you@laptop
        state: active
        error: null
        createdAt: '2027-01-04T09:14:00.000Z'
  responses:
    ComputeUnauthorized:
      description: Missing or invalid Morph API key on a compute request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ComputeError'
          example:
            error: >-
              Missing or invalid API key. Send "Authorization: Bearer <key>"
              with a key from https://www.morphllm.com/dashboard/api-keys
    ComputeAdminRequired:
      description: >-
        The account is outside the limited preview, the key is a personal key,
        or the key belongs to an organization member who is not an admin. Writes
        need an organization admin.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ComputeError'
          example:
            error: >-
              An organization admin must reserve compute. Use an API key created
              by an admin of this organization.
    ComputeNotFound:
      description: >-
        No reservation with this id belongs to the key’s organization. Another
        organization’s reservation also returns 404, so existence is never
        leaked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ComputeError'
          example:
            error: >-
              Reservation not found. List yours with GET
              /api/v1/compute/reservations.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: opaque
      description: >-
        Morph API key, passed as `Authorization: Bearer sk-...`. Create keys at
        https://www.morphllm.com/dashboard/api-keys.

````

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