---
title: "Update API Key"
method: PATCH
path: "/v1/account/keys/{key_id}"
tags: ["Account & Keys"]
---

# Update API Key

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

Update an existing API key. Requires scope: keys:update

## Path parameters

- `key_id` integer, required

## Request body

- UpdateKeyRequest
  - `label` string, nullable
  - `daily_limit` integer, nullable
  - `minute_limit` integer, nullable
  - `allowed_models` string[], nullable
  - `balance` number, nullable
  - `use_subs_first` boolean, nullable
  - `fallback_to_payg` boolean, nullable

## Response `200`

Successful Response

- AccountKeysListResponse
  - `data` AccountKeyItem[], required — A list of API keys.
    - `api_key_id` integer, required — The unique database ID of the API key.
    - `key` string, required — The masked key value (e.g. rw-abc...xyz).
    - `label` string, nullable — A human-readable label for the key.
    - `daily_limit` integer, nullable — The maximum requests/cost allowed per day.
    - `minute_limit` integer, nullable — The maximum requests allowed per minute.
    - `balance` number, nullable — Pre-allocated balance attached to the key.
    - `usage_today` number, nullable — The amount spent/used today in USD.
    - `usage_minute` integer, nullable — The number of requests in the current minute.
    - `created_at` string, required — The creation timestamp.
    - `last_used_at` string, nullable — The last usage timestamp.
    - `use_subs_first` boolean, nullable — Whether subscription quota is consumed first.
    - `fallback_to_payg` boolean, nullable — Whether key falls back to PAYG credit.

## Other responses

- `400` — Bad Request - Invalid update parameters.
- `401` — Unauthorized - Missing or invalid API key.
- `403` — Forbidden - You do not own this API key.
- `404` — Not Found - API key not found.
- `422` — Validation Error
- `429` — Too Many Requests - Rate limit exceeded.
- `500` — Internal Server Error.

---

[API](https://skmtc.dev/routeway/apis/routeway-api.md) · [All operations](https://skmtc.dev/routeway/apis/routeway-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/routeway/routeway-api/revisions/b6f03282a96b/schema)
