Credential ID • AI Agent SDK
credential_id: Stable, non-secret identity for cross-replica quota coordination.
credential_id
Method
</div>
This is a method of the AuthProfile class in the failover module.
Stable, non-secret identity for cross-replica quota coordination.
The coordinator keys benches by the credential, not the profile label. `name is a local display label: two replicas may name the same key differently (breaking cooldown propagation) or reuse a name like "default" for different keys (benching an unrelated key). Derive a deterministic id from the fields that identify the credential (provider, api_key, base_url) using a short salted hash so the real key is never exposed. Falls back to name` when no api_key is present.
Signature
def credential_id() -> strReturns
strThe result of the operation.
Uses
hexdigesthashlib.sha256encode
Source
View on GitHubpraisonaiagents/llm/failover.py at line 120