Configuration for the Anthropic model provider.
The anthropic sub-block configures the Anthropic cloud provider, which serves Claude models.
| Field | Type | Required | runtime() | Description |
|---|---|---|---|---|
models | list | no | no | Allowlist of models for this provider. Each entry is a plain string or a config object with name and params. When omitted, no allowlist is enforced. |
config | block | no | Connection configuration. | |
config.api_key | string | no | yes | Anthropic API key. Wrap in secret(runtime(...)) to keep it out of build artifacts. |
config.base_url | string | no | yes | API base URL. Useful for proxies or private endpoints. |
params | block | no | Provider-level inference parameter defaults. Applied to every request unless overridden at the model level. |
The config block is optional. When omitted, the Anthropic SDK reads credentials from the
ANTHROPIC_API_KEY environment variable using its standard resolution logic.
The params block sets inference parameter defaults for all models under this provider. All fields
are optional and support runtime().
| Field | Type | runtime() | Description |
|---|---|---|---|
max_tokens | integer | yes | Maximum number of tokens to generate. |
temperature | float | yes | Sampling temperature. |
top_p | float | yes | Nucleus sampling probability. |
top_k | integer | yes | Top-K sampling limit. |
stop_sequences | list of strings | yes | Sequences that stop generation. |
frequency_penalty | float | yes | Penalty for token frequency. |
presence_penalty | float | yes | Penalty for token presence. |
seed | integer | yes | Seed for deterministic sampling. |
provider_params | object | yes | Provider-specific parameters passed directly to the API. Use this for options not covered by the typed fields above, such as extended thinking. |
For provider-specific options not covered by these fields, such as extended thinking, use the
provider_params field of the model override at request time.
providers {
anthropic {
models = [
"claude-haiku-4-5",
{
name = "claude-opus-4-7"
params {
max_tokens = 16000
temperature = 0.8
}
}
]
config {
api_key = secret(runtime("ANTHROPIC_API_KEY"))
base_url = runtime("ANTHROPIC_BASE_URL", "https://api.anthropic.com")
}
params {
max_tokens = 4096
temperature = 0.5
}
}
}In this example, requests to claude-haiku-4-5 use the provider-level defaults
(max_tokens = 4096, temperature = 0.5). Requests to claude-opus-4-7 use its own
model-level params instead (max_tokens = 16000, temperature = 0.8).
Always wrap API keys in secret(runtime(...)). This prevents the key from appearing in build
artifacts and the output of agentc inspect.
© 2026 pogue.dev. All rights reserved.
CC BY 4.0Search the agentc documentation