---
title: "Set Workspace Provider Key Override"
method: PATCH
path: "/v1/workspaces/{workspace_id}/provider-keys/{key_id}"
tags: ["provider-keys"]
---

# Set Workspace Provider Key Override

`PATCH /v1/workspaces/{workspace_id}/provider-keys/{key_id}`

Pin or disable a key for this workspace. Organization owners/admins or this workspace's owners/admins.

## Path parameters

- `workspace_id` string, uuid, required
- `key_id` string, uuid, required

## Request body

- WorkspaceProviderKeyOverrideRequest — Tri-state: an omitted field leaves that flag unchanged. Both fields false, whether that is the merged result or a value sent explicitly, is a no-op the service deletes rather than stores: absence of a row already means full inheritance from the organization default. Setting one true auto-resolves the other when they would otherwise conflict (pinning re-enables a disabled key; disabling un-pins a pinned one); sending both true explicitly is refused.
  - `disabled` boolean, nullable
  - `is_default` boolean, nullable

## Response `200`

Successful Response

- WorkspaceProviderKeyOverridePublic — The effective view for one workspace+key: raw override flags plus the resolution.
  - `disabled` boolean, required
  - `is_default` boolean, required
  - `is_effective_default` boolean, required
  - `is_effective_enabled` boolean, required
  - `org_provider_key_id` string, uuid, required
  - `workspace_id` string, uuid, required

## 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/2d6e4912e230/schema)
