---
title: "Update Stored Provider"
method: PATCH
path: "/v1/provider-credentials/{instance}"
tags: ["providers"]
---

# Update Stored Provider

`PATCH /v1/provider-credentials/{instance}`

Update a stored provider. Omitted fields are left as-is; an explicit ``null`` clears them.

``api_key`` follows the same rule: omit it to keep the stored key, send a new
one to rotate, or send ``null`` to clear it. The row is locked ``FOR UPDATE``
so the ``expected_updated_at`` check and the write it guards are atomic.

## Path parameters

- `instance` string, required

## Request body

- UpdateStoredProviderRequest — Update a stored provider. Omitted fields are unchanged; ``api_key`` rotates in place.
  - `api_base` string, nullable
  - `api_key` string, nullable — New API key. Omit to keep the existing one. Never returned.
  - `client_args` object, nullable
  - `expected_updated_at` string, nullable — Optimistic concurrency: if set, the update 412s unless it matches the stored updated_at.
  - `provider_type` string, nullable

## Response `200`

Successful Response

- StoredProviderResponse — A runtime-stored provider. The API key is never returned, only ``last4``.
  - `api_base` string, nullable
  - `client_args` object
  - `created_at` string, nullable
  - `decryptable` boolean
  - `instance` string, required
  - `last4` string, nullable
  - `provider_type` string, nullable
  - `updated_at` string, nullable

## Other responses

- `422` — Validation Error

---

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