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

# Get instance SSH key

> Retrieve the SSH key for an instance.



## OpenAPI

````yaml /openapi/compute-openapi.yaml get /api/v2/instances/{instanceID}/sshkey
openapi: 3.0.3
info:
  title: Compute Service API
  description: >-
    The Compute Service API provides services that allows provisioning and life
    cycle

    management of Compute clusters.
  version: 1.13.0
servers:
  - url: https://compute.nks.europe-west4.nscale.com
    description: Production
security: []
paths:
  /api/v2/instances/{instanceID}/sshkey:
    description: Compute instance services.
    parameters:
      - $ref: '#/components/parameters/instanceIDParameter'
    get:
      tags:
        - Instances
      summary: Get instance SSH key
      description: Retrieve the SSH key for an instance.
      responses:
        '200':
          $ref: '#/components/responses/sshKeyResponse'
        '400':
          $ref: '#/components/responses/badRequestResponse'
        '401':
          $ref: '#/components/responses/unauthorizedResponse'
        '403':
          $ref: '#/components/responses/forbiddenResponse'
        '404':
          $ref: '#/components/responses/notFoundResponse'
        '500':
          $ref: '#/components/responses/internalServerErrorResponse'
      security:
        - oauth2Authentication: []
components:
  parameters:
    instanceIDParameter:
      name: instanceID
      in: path
      description: The instance ID.
      required: true
      schema:
        $ref: '#/components/schemas/kubernetesNameParameter'
  responses:
    sshKeyResponse:
      description: An SSH key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/sshKey'
          example:
            privateKey: |-
              -----BEGIN OPENSSH PRIVATE KEY-----
              b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtz
              c2gtZWQyNTUxOQAAACCtvR5BFiAX6+UGoPw/uG/U1Da+iN1lNHYWzk8YhPOeUwAA
              AKAhzCVJIcwlSQAAAAtzc2gtZWQyNTUxOQAAACCtvR5BFiAX6+UGoPw/uG/U1Da+
              iN1lNHYWzk8YhPOeUwAAAEClYjYgxFjEM4qh3sl7IS2dpBzSxkRT0NTy9ILygiaA
              tq29HkEWIBfr5Qag/D+4b9TUNr6I3WU0dhbOTxiE855TAAAAHXVuaWtvcm4gZXBo
              ZW1lcmFsIGVkMjU1MTkga2V5
              -----END OPENSSH PRIVATE KEY-----
    badRequestResponse:
      description: |-
        Request body failed schema validation, or the request does not contain
        all the required fields.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: invalid_request
            error_description: request body invalid
    unauthorizedResponse:
      description: Authentication failed or the access token has expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: access_denied
            error_description: authentication failed
    forbiddenResponse:
      description: >-
        Request was denied by authorization, this may be caused by the
        authorization

        token not having the required scope for an API, or the user doesn't have
        the

        necessary privileges on the provider platform.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: forbidden
            error_description: user credentials do not have the required privileges
    notFoundResponse:
      description: Unable to find a resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: not_found
            error_description: the requested resource does not exist
    internalServerErrorResponse:
      description: >-
        An unexpected or unhandled error occurred. This may be a transient error
        and

        may succeed on a retry.  If this isn't the case, please report it as an
        issue.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: server_error
            error_description: failed to token claim
  schemas:
    kubernetesNameParameter:
      description: >-
        A Kubernetes name. Must be a valid DNS containing only lower case
        characters, numbers or hyphens, start and end with a character or
        number, and be at most 63 characters in length.
      type: string
      minLength: 1
      maxLength: 63
    sshKey:
      description: An SSH key.
      type: object
      required:
        - privateKey
      properties:
        privateKey:
          description: The SSH private key.
          type: string
    error:
      description: Generic error message, compatible with oauth2.
      type: object
      required:
        - error
        - error_description
      properties:
        error:
          description: >-
            A terse error string expanding on the HTTP error code. Errors are
            based on the OAuth 2.02 specification, but are expanded with
            proprietary status codes for APIs other than those specified by
            OAuth 2.02.
          type: string
          enum:
            - invalid_request
            - server_error
            - access_denied
            - not_found
            - conflict
            - method_not_allowed
            - unsupported_media_type
            - request_entity_too_large
            - unprocessable_content
            - forbidden
        error_description:
          description: Verbose message describing the error.
          type: string
  securitySchemes:
    oauth2Authentication:
      description: Operation requires OAuth 2.0 bearer token authentication.
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://identity.nks.europe-west4.nscale.com/oauth2/v2/authorization
          tokenUrl: https://identity.nks.europe-west4.nscale.com/oauth2/v2/token
          scopes: {}

````