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

python
def credential_id() -> str

Returns

ResponseField str

The result of the operation.

Uses

  • hexdigest
  • hashlib.sha256
  • encode

Source

View on GitHub

praisonaiagents/llm/failover.py at line 120