---
title: "Get an API key"
method: GET
path: "/v1/account/keys/{key_id}"
tags: ["API Keys"]
---

# Get an API key

`GET /v1/account/keys/{key_id}`

## Request

- Base URL: `https://api.naga.ac`
- URL: `https://api.naga.ac/v1/account/keys/{key_id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/naga/apis/nagaai-api/docs/v1/account/keys/:key_id/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns one API key of the account, without its secret. Requires a provisioning key.

## Path parameters

- `key_id` integer, required

## Response `200`

The key, without its secret.

- ApiKeyResponse: One API key of the account, without its secret.
  - `id` integer, required: The key's id, which is the `{key_id}` the per-key routes take.
  - `name` string, required: The label the key carries.
  - `created_at` string, required: When the key was created: UTC to the second, without an offset.
  - `expires_at` string, nullable, required: When the key stops working, or `null` for one that never expires.
  - `is_enabled` boolean, required: Whether the key works at all.
  - `credit_limit` number, double, nullable, required: The key's own spending limit in credits, or `null` for none.
  - `credit_limit_period` 'day' | 'week' | 'month' | 'all', required: The window a key's `credit_limit` covers: a UTC day, an ISO week from Monday, a calendar month, or the key's whole life.
  - `default_routing_strategy` 'reliability' | 'balanced' | 'latency' | 'throughput' | 'cache', nullable, required: The key's default routing strategy, or `null` when NagaAI chooses.

## Other responses

- `400`: No key with this id belongs to the account — and that is a 400 here, not a 404. A deleted id and another account's id answer the same way.
- `401`: The provisioning key is missing, malformed, or belongs to no account. An ordinary API key fails here too: it reaches models, not the account.
- `500`: The gateway failed for a reason of its own. Report it — this status marks NagaAI's own bugs.
- `503`: No upstream provider could serve the request, or a store the gateway needs did not respond. `Retry-After`, when present, carries the suggested wait.

## Changes

- **2026-11-08** `26c1a63334fa`: 1 info
  - added the required property `credit_limit_period` to the response with the `200` status
- **2026-11-03** `b697d49fa1f9`: 16 breaking, 8 warning, 13 info
  - for the `path` request parameter `key_id`, the format changed from no format to `int64`
  - the response property `credit_limit` became nullable for the status `200`
  - the response property `expires_at` became nullable for the status `200`
  - the `created_at` response's property format changed from `date-time` to no format for status `200`
  - …33 more

[Operation history](https://skmtc.dev/naga/apis/nagaai-api/changes/v1/account/keys/:key_id/get.md)

---

[API](https://skmtc.dev/naga/apis/nagaai-api.md) - [All operations](https://skmtc.dev/naga/apis/nagaai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/naga/apis/nagaai-api/revisions/32adec8b3b00?raw)
