---
title: "Update"
method: PATCH
path: "/ai_gateway_provider_keys/{id}"
tags: ["AIGatewayProviderKeys"]
---

# Update

`PATCH /ai_gateway_provider_keys/{id}`

Update an existing AI Gateway Provider Key by ID

## Path parameters

- `id` string, required

## Headers

- `ngrok-version` integer, required

## Request body

- AIGatewayProviderKeyUpdate
  - `id` string — unique identifier for this provider key
  - `description` string — human-readable description of this provider key
  - `metadata` string — arbitrary user-defined metadata for this provider key

## Response `200`

Update an existing AI Gateway Provider Key by ID

- AIGatewayProviderKey
  - `id` string — unique identifier for this provider key
  - `uri` string — URI of this AI Gateway Provider Key API resource
  - `created_at` string — Timestamp when the provider key was created (RFC 3339 format)
  - `updated_at` string — Timestamp when the provider key was last updated (RFC 3339 format)
  - `provider_id` string — which AI provider this key is for, e.g. "openai", "anthropic"
  - `description` string — human-readable description of this provider key
  - `metadata` string — arbitrary user-defined metadata for this provider key
  - `created_by` Ref
    - `id` string — a resource identifier
    - `uri` string — a uri for locating a resource
  - `last_updated_by` Ref
    - `id` string — a resource identifier
    - `uri` string — a uri for locating a resource
  - `ai_gateway_api_key` Ref
    - `id` string — a resource identifier
    - `uri` string — a uri for locating a resource
  - `display_name` string — redacted display form of the key value, e.g. sk-abc***xyz
  - `last_used` string — Timestamp when the provider key was last used (RFC 3339 format)

## Other responses

- `4XX` — An error. The body carries a machine-readable error_code and a human-readable msg; every code is documented at https://ngrok.com/docs/errors. A 429 with error code ERR_NGROK_226 means the account exceeded the documented request-rate limit.
- `5XX` — An error. The body carries a machine-readable error_code and a human-readable msg; every code is documented at https://ngrok.com/docs/errors. A 429 with error code ERR_NGROK_226 means the account exceeded the documented request-rate limit.

## Changes

- **2026-08-25** `c697539ac350` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/ngrok/apis/ngrok-openapi/changes/ai_gateway_provider_keys/:id/patch.md)

---

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