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

# Get a key's value

> Returns the raw stored value for a key. The response body is the value exactly as it was written; the `Content-Type` header echoes the value's stored content type (defaults to `application/octet-stream`).



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/edge-compute.yml get /storage/kvs/{id}/keys/{key}
openapi: 3.1.0
info:
  title: Telnyx Edge Compute API
  version: 2.0.0
  description: API for Edge Compute key-value storage (namespaces and keys).
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /storage/kvs/{id}/keys/{key}:
    get:
      tags:
        - kv keys
      summary: Get a key's value
      description: >-
        Returns the raw stored value for a key. The response body is the value
        exactly as it was written; the `Content-Type` header echoes the value's
        stored content type (defaults to `application/octet-stream`).
      operationId: GetKvKey
      parameters:
        - description: KV namespace ID
          name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - description: >-
            Key name. Allowed characters: `a-z A-Z 0-9 - _ / = .`; maximum 256
            characters; names starting with `_` are reserved for system use. May
            contain `/`; URL-encode it so the whole string is treated as one key
            (for example `user/1` -> `user%2F1`).
          name: key
          in: path
          required: true
          schema:
            type: string
            maxLength: 256
            pattern: ^[-/_=.a-zA-Z0-9]+$
      responses:
        '200':
          description: >-
            Value retrieved successfully. The `Content-Type` header is the
            value's stored content type (defaults to
            `application/octet-stream`).
          content:
            '*/*':
              schema:
                type: string
                format: binary
        '400':
          description: Bad request — invalid `id` or key name
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/edge-compute_Errors'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/edge-compute_Errors'
        '404':
          description: Key or namespace not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/edge-compute_Errors'
        '409':
          description: >-
            Conflict — the namespace is not ready (`status` is not
            `provision_ok`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/edge-compute_Errors'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericErrorResponse'
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });


            const response = await client.storage.kvs.keys.retrieve('id',
            'key');


            console.log(response.data);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            response = client.storage.kvs.keys.retrieve(
                "id",
                "key",
            )
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tkey, err := client.Storage.Kvs.Keys.Get(\n\t\tcontext.TODO(),\n\t\t\"id\",\n\t\t\"key\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", key.Data)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    Object response = client.storage()kvs()keys()retrieve("id", "key");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            response = telnyx.storage.kvs.keys.retrieve("id", "key")

            puts(response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $response = $client->storage->kvs->keys->retrieve(
                'id',
                'key',
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx storage:kvs:keys retrieve \
              --api-key 'My API Key' \
              --id id \
              --key key
components:
  schemas:
    edge-compute_Errors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/edge-compute_Error'
    GenericErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/edge-compute_Error'
    edge-compute_Error:
      type: object
      properties:
        code:
          type: string
          example: '10005'
        detail:
          type: string
          example: The requested function does not exist or you don't have access to it
        meta:
          $ref: '#/components/schemas/ErrorMeta'
        source:
          $ref: '#/components/schemas/ErrorSource'
        title:
          type: string
          example: Function not found
    ErrorMeta:
      type: object
      properties:
        url:
          type: string
          example: https://docs.telnyx.com/api/errors/10005
    ErrorSource:
      type: object
      properties:
        parameter:
          type: string
          example: id
        pointer:
          type: string
          example: /id
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````