Claude
Parameters
The Anthropic SDK client that sends the requests; the caller owns and closes it.
The default max_tokens (8192), used when the request config sets none.
How much reasoning effort Claude spends on each request; null leaves the model's default. While effort or thinking is on, temperature, topP, and topK are not sent.
Creates a Claude model that calls the Anthropic API directly. The SDK client it creates is closed when the model is garbage collected; pass your own AnthropicClient to close it sooner.
Parameters
The Claude model name (e.g. claude-sonnet-4-5).
The Anthropic API key; when null or blank, the SDK reads credentials from the environment, such as ANTHROPIC_API_KEY.
The default max_tokens (8192), used when the request config sets none.
How much reasoning effort Claude spends on each request; null leaves the model's default. While effort or thinking is on, temperature, topP, and topK are not sent.
Throws
If no API key is passed and the environment has no credential.
Creates a Claude model served through Vertex AI. The SDK client it creates is closed when the model is garbage collected; pass your own AnthropicClient to close it sooner.
Parameters
The Claude model id as published on Vertex AI (e.g. claude-haiku-4-5), or its full resource name, which also names the project and location.
The Vertex AI project, location, and credentials. Project and location fall back to those in a resource name, then to the GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION environment variables; credentials default to Application Default Credentials.
The default max_tokens (8192), used when the request config sets none.
How much reasoning effort Claude spends on each request; null leaves the model's default. While effort or thinking is on, temperature, topP, and topK are not sent.
Throws
If no project or location is set.
If no credentials are set and Application Default Credentials are unavailable.