---
title: "Update Key"
method: PATCH
path: "/v1/keys/{key_id}"
tags: ["keys"]
---

# Update Key

`PATCH /v1/keys/{key_id}`

Update an API key in the caller's organization.

Requires master key authentication.

## Path parameters

- `key_id` string, required

## Request body

- UpdateKeyRequest — Request model for updating a key.
  - `allowed_models` string[], nullable
  - `capture_agent_telemetry` boolean, nullable
  - `exclude_from_budget` boolean, nullable
  - `expires_at` string, date-time, nullable
  - `is_active` boolean, nullable
  - `key_name` string, nullable
  - `metadata` object, nullable
  - `reject_user_mismatch` boolean, nullable

## Response `200`

Successful Response

- KeyInfo — Response model for key information.
  - `allowed_models` string[], nullable, required
  - `capture_agent_telemetry` boolean, nullable, required
  - `created_at` string, required
  - `exclude_from_budget` boolean, required
  - `expires_at` string, nullable, required
  - `id` string, required
  - `is_active` boolean, required
  - `key_name` string, nullable, required
  - `key_prefix` string, nullable, required
  - `last_used_at` string, nullable, required
  - `metadata` object, required
  - `reject_user_mismatch` boolean, nullable, required
  - `user_id` string, nullable, required
  - `workspace_id` string, uuid, required

## Other responses

- `422` — Validation Error

## Changes

> 126 revisions in range; 98 could not be searched.

- **2026-04-17** `0f43605bdc13` — 1 info
  - the endpoint scheme security `ApiKeyAuth` was removed from the API

[Change history](https://skmtc.dev/mozilla-ai/apis/otari/changes/v1/keys/:key_id/patch.md)

---

[API](https://skmtc.dev/mozilla-ai/apis/otari.md) · [All operations](https://skmtc.dev/mozilla-ai/apis/otari/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mozilla-ai/otari/revisions/7f178e92b56c/schema)
