CumulusDocs
Open Studio
On this page

Set a provider credential

Set or rotate a model-provider credential. The provider validates it before storage.

Operation ID: provider_keys.put.

Request

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

  • TypeScript SDK: client.provider_keys.put (path arguments use path).
  • MCP tool: sdk_client_call with operationId: "provider_keys.put" (path arguments use input.path). Legacy alias: provider_keys_put. Connect to your authenticated /mcp endpoint with an API key for the same environment.
  • Minimum API key role: admin.
  • Idempotency: No header required; the resource or revision identifies the change.

Read resource IDs from earlier responses and use a key for the same environment.

Request example

Choose the provider in the path and replace this invalid sample with its real key from your secret manager. The server validates the key with the provider before storing it; an unavailable check stores nothing. Secret encryption must be configured. Keep it out of logs and source control; provider_keys.list shows configured status without revealing the secret.

Set CUMULUS_BASE_URL to your workspace API URL and CUMULUS_API_KEY to a key for that environment. Example values are synthetic.

cURL

curl
curl --fail-with-body -sS -X PUT "${CUMULUS_BASE_URL%/}/api/v1/provider-keys/${PROVIDER}" \
  -H "Authorization: Bearer $CUMULUS_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "api_key": "example-provider-key-not-valid"
}'

TypeScript

typescript
import { Cumulus } from "@cumulus/sdk";

const baseUrl = process.env.CUMULUS_BASE_URL;
const apiKey = process.env.CUMULUS_API_KEY;
if (!baseUrl || !apiKey) throw new Error("Set CUMULUS_BASE_URL and CUMULUS_API_KEY");
const client = new Cumulus({ baseUrl, apiKey });

const response = await client.provider_keys.put({
  "path": {
    "provider": "elevenlabs"
  },
  "body": {
    "api_key": "example-provider-key-not-valid"
  }
});

Input schema

Path, query and header parameters

provider

path parameter · Required.

Type: "elevenlabs" · "openai" · "cerebras".

JSON request body

FieldType or valuesRequiredDescription and limits
api_keystringRequiredminLength: 8. maxLength: 512.
Complete OpenAPI schema
OpenAPI 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

HTTP 200

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

application/json

FieldType or valuesRequiredDescription and limits
provider"elevenlabs" · "openai" · "cerebras"Required—
source"platform" · "tenant"Required—
last4string or nullRequiredminLength: 1. maxLength: 4.
fingerprintstring or nullRequiredpattern: ^sha256:[a-f0-9]{12}$.
validated_atstring (date-time) or nullRequiredpattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$.
updated_atstring (date-time) or nullRequiredpattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$.
last_rejectionobject or nullRequired—
last_rejection.reasonstringRequired in a non-null parentminLength: 1. maxLength: 64.
last_rejection.last4stringRequired in a non-null parentminLength: 1. maxLength: 4.
last_rejection.fingerprintstringRequired in a non-null parentpattern: ^sha256:[a-f0-9]{12}$.
last_rejection.atstring (date-time)Required in a non-null parentpattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$.

Error responses

HTTPDescription
4XXTyped error (ApiError)
5XXTyped error (ApiError)

Errors use the shared error envelope. Inspect error.code, retryable, outcome and details before retrying.

Complete OpenAPI schema
OpenAPI 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

Expand the complete OpenAPI definitions for integrations that generate their own clients.

Complete OpenAPI schema
OpenAPI 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": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 4
          },
          "fingerprint": {
            "nullable": true,
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{12}$"
          },
          "validated_at": {
            "nullable": true,
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "updated_at": {
            "nullable": true,
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "last_rejection": {
            "nullable": true,
            "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",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              }
            },
            "required": [
              "reason",
              "last4",
              "fingerprint",
              "at"
            ],
            "additionalProperties": false
          }
        },
        "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

See API error handling and Troubleshooting.

Content version 7fb26e4aCustomer SDKMarkdown source
Set a provider credential · Cumulus developer docs