| Name | Type | Description |
|---|---|---|
provider* | str | Provider identifier (e.g., |
key* | str | The API key value. Whitespace is stripped before storage. |
base_url | str | None | Default: NoneOptional provider endpoint to pair with the key. Whitespace
is stripped; blank/ |
project | str | None | Default: None |
Persist an API key for provider.
Empty / whitespace-only keys are rejected so callers don't accidentally
write a sentinel that masks a working environment variable (see
apply_stored_credentials in model_config — a stored empty would
unconditionally overwrite the env var).
This rewrites the whole credential record: base_url and project are
not merged with any previously stored values. Passing blank/None for
either clears it, so a caller rotating a key while wanting to keep the
existing endpoint/project must read it back (e.g. via get_stored_base_url
/ get_stored_project) and pass it in again.
Optional LangSmith project name to pair with the key. Valid
only for the langsmith tracing service. Whitespace is stripped;
blank/None stores no project, meaning traces use the default
project.