Enum AuthStrategy Copy item path Source pub enum AuthStrategy {
Bedrock,
Vertex,
ApiKey,
OauthToken,
Subscription,
}Expand description Active auth strategy, as inferred from the host environment.
See module-level docs for precedence rules.
CLAUDE_CODE_USE_BEDROCK is truthy. Requests are routed to
AWS Bedrock; AWS credentials are resolved separately by the
Bedrock SDK from the host environment.
CLAUDE_CODE_USE_VERTEX is truthy. Requests are routed to
Google Vertex; GCP credentials are resolved separately.
ANTHROPIC_API_KEY is set. Direct API access, billed to that key.
CLAUDE_CODE_OAUTH_TOKEN is set. OAuth token (typically from
claude setup-token).
No auth env var set. The CLI will look for stored credentials
under ~/.claude/ (the result of an interactive claude login).
May or may not actually be authenticated – this strategy
reports “the env doesn’t pin anything,” not “you are logged in.”
Stable string label, useful for logs and protocol payloads.
Matches the serde_json representation.
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Serialize this value into the given Serde serializer.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Instruments this type with the provided
Span, returning an
Instrumented wrapper.
Read more Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.