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

# Get SSH key

> Retrieves a single SSH key by ID.



## OpenAPI

````yaml /api-reference/services_documented/object_storage_api.yaml get /storage/v4/ssh_keys/{ssh_key_id}
openapi: 3.1.0
info:
  title: Gcore OpenAPI – Object Storage API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: '2026-05-14T07:00:22.640261+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: Notifications
    x-displayName: Notifications
  - name: SSHKeys
    x-displayName: SSHKeys
  - name: Storage Locations
    x-displayName: Storage Locations
  - name: Storage
    x-displayName: Storage
  - name: Storage Statistics
    x-displayName: Storage Statistics
  - name: S3-Compatible Storage
    x-displayName: S3-Compatible Storage
  - name: SFTP Storage
    x-displayName: SFTP Storage
paths:
  /storage/v4/ssh_keys/{ssh_key_id}:
    get:
      tags:
        - SSHKeys
      summary: Get SSH key
      description: Retrieves a single SSH key by ID.
      operationId: getSshKeyV4
      parameters:
        - name: ssh_key_id
          in: path
          description: SSH key ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: SSHKeyV4
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SSHKeyV4'
        '400':
          description: ErrResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrResponse'
        '401':
          description: ErrResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrResponse'
        '404':
          description: ErrResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrResponse'
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from gcore import Gcore

            client = Gcore(
                api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
            )
            ssh_key = client.storage.ssh_keys.get(
                0,
            )
            print(ssh_key.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/G-Core/gcore-go\"\n\t\"github.com/G-Core/gcore-go/option\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tsshKey, err := client.Storage.SSHKeys.Get(context.TODO(), 0)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", sshKey.ID)\n}\n"
components:
  schemas:
    SSHKeyV4:
      title: >-
        SSHKeyV4 SSH public key for passwordless SFTP storage authentication.
        Link keys to SFTP storages via the storage update endpoint.
      required:
        - created_at
        - id
        - name
        - public_key
      type: object
      properties:
        created_at:
          type: string
          description: ISO 8601 timestamp when the SSH key was created
          format: date-time
          example: '2025-08-05T09:15:00Z'
        id:
          type: integer
          description: Unique identifier for the SSH key
          format: int64
          example: 123
        name:
          type: string
          description: User-defined name for the SSH key
          example: my-production-key
        public_key:
          type: string
          description: The SSH public key content
          example: ssh-rsa AAAAB3NzaC1yc2EAAA... user@example.com
    ErrResponse:
      type: object
      properties:
        error:
          type: string
      description: ErrResponse is an error response
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````