Provider Keys - Python SDK
client.provider_keys manages caller-owned credentials for external model
providers. The SDK sends these values only to provider-key APIs.
Overview
Available Operations
| Method | Description |
|---|---|
providers() | List supported provider identifiers and labels. |
list(owner_id=None) | List masked provider keys; admin callers may filter by owner. |
create(body) | Store a new provider credential. |
update(id, body) | Rotate the credential or update its description. |
change_status(id, body) | Enable or disable a provider key. |
test(id) | Test provider connectivity with the stored key. |
delete(id) | Delete a provider key. |
providers
List supported provider identifiers and labels.
Request
This method has no parameters and sends no request body.
Response
list[ProviderInfo].
list
List masked provider keys; admin callers may filter by owner.
Request
Optional keyword-only owner_id.
Response
list[ProviderKeyVO].
create
Store a new provider credential.
Request
Required provider, apiKey; optional description.
Response
ProviderKeyVO.
update
Rotate the credential or update its description.
Request
id required; optional apiKey, description.
Response
Updated ProviderKeyVO.
change_status
Enable or disable a provider key.
Request
id and body {status} required.
Response
None.
test
Test provider connectivity with the stored key.
Request
id required.
Response
ConnectionTestResult.
delete
Delete a provider key.
Request
id required.
Response
None.
Field Reference and Examples
ProviderInfo contains provider, label, and baseUrl. ProviderKeyVO
contains id, ownerId, provider, maskedApiKey, description, status,
available, unavailableReasonCode, and createdAt. Connection tests return
success and message. Use the provider identifier returned by
providers(), not its display label.
providers = client.provider_keys.providers()
keys = client.provider_keys.list()
created = client.provider_keys.create({
"provider": providers[0]["provider"],
"apiKey": "provider-api-key",
"description": "integration credential",
})
key_id = created["id"]
result = client.provider_keys.test(key_id)
updated = client.provider_keys.update(key_id, {"description": "rotated"})
client.provider_keys.change_status(key_id, {"status": 1})
client.provider_keys.delete(key_id)
All methods use the shared authentication and typed error behavior described in Response Conventions and Retry and Security.