> For the complete documentation index, see [llms.txt](https://docs.cheqd.io/product/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cheqd.io/product/api-reference/keys/fetch.md).

# Fetch a Key

## Fetch an identity key pair.

> This endpoint fetches an identity key pair's details for a given key ID. Only the user account associated with the custodian-mode client can fetch the key pair.

```json
{"openapi":"3.0.0","info":{"title":"cheqd Studio API for cheqd network","version":"2.0.0"},"tags":[{"name":"Keys"}],"servers":[{"url":"https://studio-api.cheqd.net","description":"Main (production) server"},{"url":"https://studio-api-staging.cheqd.net","description":"Staging server for testing"},{"url":"http://localhost:3000","description":"Local server for testing"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"x-api-key","in":"header"}},"schemas":{"KeyResult":{"type":"object","properties":{"kid":{"type":"string"},"type":{"type":"string","enum":["Ed25519","Secp256k1"]},"publicKeyHex":{"type":"string"}}},"InvalidRequest":{"description":"A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.","type":"object","properties":{"error":{"type":"string"}}},"UnauthorizedError":{"description":"Access token is missing or invalid","type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/key/read/{kid}":{"get":{"tags":["Keys"],"summary":"Fetch an identity key pair.","description":"This endpoint fetches an identity key pair's details for a given key ID. Only the user account associated with the custodian-mode client can fetch the key pair.","parameters":[{"name":"kid","description":"Key ID of the identity key pair to fetch.","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"The request was successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyResult"}}}},"400":{"description":"A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/schemas/UnauthorizedError"},"500":{"description":"An internal error has occurred. Additional state information plus metadata may be available in the response body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cheqd.io/product/api-reference/keys/fetch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
