powered by
Factory function to create an Anthropic provider.
create_anthropic( api_key = NULL, base_url = NULL, api_version = NULL, headers = NULL, name = NULL )
An AnthropicProvider object.
Anthropic API key. Defaults to ANTHROPIC_API_KEY env var.
Base URL for API calls. Defaults to https://api.anthropic.com/v1.
Anthropic API version header. Defaults to "2023-06-01".
Optional additional headers.
Optional provider name override.
# \donttest{ if (interactive()) { anthropic <- create_anthropic(api_key = "sk-ant-...") model <- anthropic$language_model("claude-sonnet-4-20250514") } # }
Run the code above in your browser using DataLab