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

# Get an API key

> Fetch metadata for one federated API key by its prefix. The plaintext key is never returned after creation.

Fetch one federated API key by its `prefix`. Only metadata is returned; the plaintext key is shown exactly once at creation and is unrecoverable afterward. To inspect the model access and limits the key resolves to, fetch its [group](/reference/gateway/groups/get-a-group) and read the `effective_models` block.

### Authentication

<ParamField header="Authorization" type="string" required>
  Workspace API key with management scope, formatted as `Api-Key <your-key>`.
</ParamField>

### Path parameters

<ParamField path="group_id" type="string" required>
  Internal Baseten ID of the owning group.
</ParamField>

<ParamField path="api_key_prefix" type="string" required>
  The key's prefix (the substring before the `.` in the full key string). Returned as `prefix` from [Create an API key](/reference/gateway/api-keys/create-an-api-key) and from [List API keys for a group](/reference/gateway/api-keys/list-api-keys-for-a-group).
</ParamField>

### Response

<ResponseField name="prefix" type="string" required>
  The key's prefix.
</ResponseField>

<ResponseField name="name" type="string">
  Display name set when the key was minted. `null` if no name was provided.
</ResponseField>

### Errors

| Status          | Meaning                                                                                           |
| --------------- | ------------------------------------------------------------------------------------------------- |
| `403 Forbidden` | The group or key exists but isn't in your workspace, or the caller doesn't have management scope. |
| `404 Not Found` | No group or key with these identifiers in your workspace, or the key has been revoked.            |

<RequestExample>
  ```bash curl theme={"system"}
  curl --request GET \
    --url https://api.baseten.co/v1/gateway/groups/abc123hash/api_keys/aBcDeFg \
    --header "Authorization: Api-Key $BASETEN_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"system"}
  {
    "prefix": "aBcDeFg",
    "name": "prod-key-1"
  }
  ```
</ResponseExample>
