> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Credential ID • AI Agent SDK

> credential_id: Stable, non-secret identity for cross-replica quota coordination.

# credential\_id

Method

> This is a method of the [**AuthProfile**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/AuthProfile.md) class in the [**failover**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/failover.md) 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 theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def credential_id() -> str
```

### Returns

**Returns** `str`

The result of the operation.

## Uses

* `hexdigest`
* `hashlib.sha256`
* `encode`

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/llm/failover.py#L120)
>
> `praisonaiagents/llm/failover.py` at line 120


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.