claude/client

Types

Configuration for the Anthropic API client.

pub type Config {
  Config(
    api_key: String,
    base_url: String,
    default_model: String,
    default_max_tokens: Int,
  )
}

Constructors

  • Config(
      api_key: String,
      base_url: String,
      default_model: String,
      default_max_tokens: Int,
    )

Values

pub fn new(api_key: String) -> Config

Create a new Config with sensible defaults.

Defaults:

  • base_url: “https://api.anthropic.com”
  • default_model: “claude-sonnet-4-5-20250929”
  • default_max_tokens: 4096
pub fn with_base_url(config: Config, url: String) -> Config

Set the base URL on the config.

pub fn with_max_tokens(config: Config, max_tokens: Int) -> Config

Set the default max tokens on the config.

pub fn with_model(config: Config, model: String) -> Config

Set the model on the config.

Search Document