Brain Docs

Reference

Python SDKInstallationHTTP clientWire clientSync vs async
put_llm_credentialget_llm_credentialtest_llm_credentialverify_llm_credentialdelete_llm_credential
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Python SDKCredentialsput_llm_credential

put_llm_credential

Register or replace the namespace's provider key — verified with the provider before it is stored.

PURPOSE

Register or replace the namespace's provider key. The edge verifies it with the provider before storing it, so a bad key fails here rather than on the first extraction.

PUT/v1/llm-credentialBearer API keystable
put_llm_credential(provider: str, model: str, api_key: str) -> LlmCredential

Parameters

ParameterTypeRequired
providerstringrequired

The provider the key belongs to.

modelstringrequired

The model to use for extraction. Pick one with enough output budget — a reasoning model given a small cap returns empty forever and bills every retry.

api_keystringrequired

The key. Sealed on arrival and never readable again through the API.

Returns

FieldTypePresence
provider / modelstringalways

What was registered.

fingerprintstringalways

A stable digest of the key — enough to tell two keys apart and confirm which is installed, and not enough to use.

created_at_unix_secsintegeralways

When it was registered. Note: seconds, not the nanoseconds used everywhere else in the API.

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.

This verb is not retried by the SDK. A PUT that may have landed is not safe to repeat blind when what it replaces is a live credential.

See also
test_llm_credentialNamespaces

Was this page helpful?

txn_abort

Discard a transaction's writes without waiting for its timeout.

get_llm_credential

See which provider key is installed — provider, model and fingerprint, never the key.

On this page

ParametersReturns
Suggest an editOpen in Playground