The provider block declares a model provider and how to connect to it.
The provider block declares a model provider the agent may use and how to connect to it. A manifest
can contain any number of provider blocks, including several of the same kind. The value of
agent.model.provider must be the label of one of them. The kind field determines the provider type
and which fields the block accepts.
provider "anthropic" {
kind = "anthropic"
models = ["claude-haiku-4-5"]
config {
api_key = secret(runtime("ANTHROPIC_API_KEY"))
}
}
agent "assistant" {
graph {
type = "react"
}
model {
provider = "anthropic"
name = "claude-haiku-4-5"
}
}The block label names the provider within the manifest. agent.model.provider refers to a provider by
its label, and errors raised by a provider name its label. A label is chosen freely and may equal a
kind name.
All provider blocks follow the same general shape. Which model entries models takes, which fields
config accepts, and which inference parameters take effect differ per kind and are documented on each
kind's reference page.
kind is required and selects the provider type. It is always build-time and cannot be wrapped in
runtime().
models is an optional list of model entries. When present it acts as an allowlist: only the
named models may be used in agent.model.name when this provider is selected. When absent, any
model name is accepted. Each entry is either a plain model name string, or a config object with a
name field and an optional params block for model-specific inference parameter overrides:
models = [
"claude-haiku-4-5",
{
name = "claude-sonnet-4-6"
params {
max_tokens = 8192
temperature = 0.7
}
}
]config is an optional block containing connection settings such as API keys and base URLs. Its
fields, and what each falls back to when unset, are documented on each kind's page.
params is an optional block that sets inference parameter defaults for every model request made
through this provider. These defaults are baked into every model instance at startup. Individual
model entries in the models list can override specific fields by declaring their own params
block. Model-level values take precedence over provider-level values.
params {
max_tokens = 4096
temperature = 0.5
}runtime() may wrap any config or params value to defer its resolution to deployment time. This
lets you supply keys, URLs, and parameter values via environment variables without hardcoding them in
the manifest.
secret() should additionally wrap any value that is sensitive. Marking a value as secret
prevents it from appearing in build artifacts and in the output of agentc inspect. API keys should
always be written as secret(runtime("ENV_VAR_NAME")).
Each value set in a provider block has a config path under the block's label, and can be set at
startup through the AGENT__ environment variable of the same path, as described in
Deploy standalone.
| Value | Config path | Environment variable |
|---|---|---|
config.<field> | provider.<label>.<field> | AGENT__PROVIDER__<LABEL>__<FIELD> |
params.<field> | provider.<label>.params.<field> | AGENT__PROVIDER__<LABEL>__PARAMS__<FIELD> |
params.<field> of a models entry | provider.<label>.<model>.<field> | AGENT__PROVIDER__<LABEL>__<MODEL>__<FIELD> |
A label containing characters other than letters, digits, and underscores is converted to snake case,
so the label my-cloud has the path provider.my_cloud. In <model>, every character of the model
name other than a letter or digit becomes _, so claude-opus-4-7 becomes claude_opus_4_7.
export AGENT__PROVIDER__ANTHROPIC__API_KEY=your_key_here
export AGENT__PROVIDER__ANTHROPIC__PARAMS__TEMPERATURE=0.2| Kind | Description | Reference |
|---|---|---|
anthropic | Anthropic cloud API. Supports Claude models. | anthropic |
openai | OpenAI cloud API and compatible endpoints. | openai |
ollama | Local Ollama runtime. No API key required. | ollama |
openrouter | OpenRouter API. Proxies hundreds of models from many providers through a single API key. | openrouter |
xai | xAI cloud API. Supports Grok models. | xai |
gemini | Google Gemini API. Supports Gemini models. | gemini |
huggingface | Hugging Face router for chat completion models. | huggingface |
© 2026 pogue.dev. All rights reserved.
CC BY 4.0