Compute / task

Create a key pair

Create a key pair before you launch an instance. Import a key you already have, or have the platform generate one.

Before you begin

  • A project to create the key pair in. Key pairs belong to one project.
  • The origin CLI, signed in. See CLI access.

Import an existing key

  1. If you don’t have a key yet, create one locally:

    Terminal window
    ssh-keygen -t ed25519 -f ~/.ssh/origin-cloud
  2. Import its public half. Pass the full OpenSSH public key line:

    Terminal window
    origin compute import-key-pair \
    --project-urn <project-urn> \
    --name my-key \
    --public-key "$(cat ~/.ssh/origin-cloud.pub)"

    A key with an unsupported type, or more than one line, is refused.

  3. Verify that the key pair is listed:

    Terminal window
    origin compute list-key-pairs --project-urn <project-urn>

Generate a key pair

  1. Generate the key pair:

    Terminal window
    origin compute generate-key-pair \
    --project-urn <project-urn> \
    --name my-key

    The response contains privateKey, an ssh-ed25519 private key in OpenSSH format.

  2. Save privateKey to a file right away, and restrict its permissions:

    Terminal window
    chmod 600 ~/.ssh/origin-cloud

    Important: The private key is returned only in this response. The platform doesn’t store it and can’t show it again. If you lose it, delete the key pair and create a new one.

  3. Verify that the key pair is listed:

    Terminal window
    origin compute list-key-pairs --project-urn <project-urn>

Using the API

The importKeyPair and generateKeyPair mutations take the same inputs. Request privateKey in the generateKeyPair selection, or you can’t get it later:

mutation {
compute {
generateKeyPair(input: { projectUrn: "<project-urn>", name: "my-key" }) {
urn
publicKey
privateKey
}
}
}

Next steps

Origin Cloud — user documentation · last reviewed 2026-10-03 Legal notice Privacy policy