Brain Docs

Reference

Rust SDKInstallationHTTP clientWire client
put_llm_credentialget_llm_credentialtest_llm_credentialverify_llm_credentialdelete_llm_credential
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Rust SDKCredentialsverify_llm_credential

verify_llm_credential

Re-check the stored key — a key that worked at registration can be revoked later.

PURPOSE

Re-check the key already stored. A key that worked at registration can be revoked or run out of credit later; without this verb the first sign is an opaque upstream failure on a write.

POST/v1/llm-credential/verifyBearer API keystable
async fn verify_llm_credential(&self) -> Result<LlmCredentialCheck, BrainHttpError>

Returns

FieldTypePresence
status / valid / reason / providerLlmCredentialCheckalways

The same shape test_llm_credential returns. valid absent still means no verdict, not a failure.

Brain never takes a provider key from a request

The key is registered once, through these verbs, and sealed. It is never accepted as a per-request field, never returned by any read, and never configured on the Brain server itself. Anything that looks like a deploy-time provider key is from an older design. See Namespaces.

These five verbs exist on the HTTP tier only — the wire protocol has no credential routes.

When there is no usable credential

Extraction that needs the LLM fails with a typed error rather than degrading silently:

CodeStatusRetry
llm_credential.missing409fatal

No credential is registered. Deliberately a 409 and not a 503: the SDK's retry list is transport failures, 429 and 503, and this condition cannot self-heal, so retrying would spin forever against a tenant that simply has not registered a key. Wire code LlmCredentialMissing.

llm_credential.unavailable503retriable

A credential exists but the broker could not resolve or use it. A 503 precisely so clients do retry; collapsing it into the 409 would permanently fail writes for a healthy tenant. Wire code LlmCredentialUnavailable.

Non-LLM extraction — the pattern and classifier extractors — is unaffected, and encode and recall keep working. See Policies.

See also
ErrorsPolicies

Was this page helpful?

test_llm_credential

Check a candidate key without storing it — safe against a namespace that already works.

delete_llm_credential

Remove the namespace's provider key, and learn whether there was one to remove.

On this page

ReturnsWhen there is no usable credential
Suggest an editOpen in Playground