Source: https://docs.cumuluslabs.io/reference/provider_keys.put
Content version: 1e243f4e

# provider_keys.put

Set or rotate the tenant's own key for a model provider; the provider checks it before it is stored

## Request {#request}

`PUT /api/v1/provider-keys/{provider}`

- MCP: `provider_keys_put`
- SDK: `client.provider_keys.put` (SDK path arguments use `path`; MCP uses `params`).
- Minimum API key role: **admin**.
- Idempotency: **natural**.

Use the request schema below. Read IDs from earlier operation results.

## Input schema {#input-schema}

```json
{
  "parameters": [
    {
      "name": "provider",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "enum": [
          "elevenlabs",
          "openai",
          "cerebras"
        ]
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ProviderKeysPutRequest"
        }
      }
    }
  }
}
```

## Responses {#responses}

```json
{
  "200": {
    "description": "Set or rotate the tenant's own key for a model provider; the provider checks it before it is stored",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ProviderKeysDeleteResponse200"
        }
      }
    }
  },
  "4XX": {
    "description": "Typed error (ApiError)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  },
  "5XX": {
    "description": "Typed error (ApiError)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  }
}
```

## Referenced schemas {#schemas}

```json
{
  "components": {
    "schemas": {
      "ProviderKeysPutRequest": {
        "type": "object",
        "properties": {
          "api_key": {
            "type": "string",
            "minLength": 8,
            "maxLength": 512
          }
        },
        "required": [
          "api_key"
        ],
        "additionalProperties": false
      },
      "ProviderKeysDeleteResponse200": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "elevenlabs",
              "openai",
              "cerebras"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "platform",
              "tenant"
            ]
          },
          "last4": {
            "allOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 4
              }
            ],
            "nullable": true
          },
          "fingerprint": {
            "allOf": [
              {
                "type": "string",
                "pattern": "^sha256:[a-f0-9]{12}$"
              }
            ],
            "nullable": true
          },
          "validated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "last_rejection": {
            "type": "object",
            "properties": {
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "last4": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4
              },
              "fingerprint": {
                "type": "string",
                "pattern": "^sha256:[a-f0-9]{12}$"
              },
              "at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "reason",
              "last4",
              "fingerprint",
              "at"
            ],
            "additionalProperties": false,
            "nullable": true
          }
        },
        "required": [
          "provider",
          "source",
          "last4",
          "fingerprint",
          "validated_at",
          "updated_at",
          "last_rejection"
        ],
        "additionalProperties": false
      },
      "ApiError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "unauthenticated",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "invalid_request",
                  "idempotency_conflict",
                  "policy_denied",
                  "capability_unavailable",
                  "provider_unavailable",
                  "knowledge_unavailable",
                  "publication_invalid",
                  "run_not_active",
                  "rate_limited",
                  "outcome_unknown",
                  "internal"
                ]
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean"
              },
              "outcome": {
                "type": "string",
                "enum": [
                  "none",
                  "unknown"
                ]
              },
              "details": {
                "type": "object",
                "additionalProperties": {}
              }
            },
            "required": [
              "code",
              "message",
              "retryable",
              "outcome"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    }
  }
}
```

## Errors and recovery {#errors}

See [API error handling](https://docs.cumuluslabs.io/api#errors) and [Troubleshooting](https://docs.cumuluslabs.io/troubleshooting).

## Related guides {#related-guides}

- [Using the API](https://docs.cumuluslabs.io/api)
