Skip to content

Provider configuration

Provider matrix

model_providerDefault base URLDefault env_keyDefault wireAuthentication sent by tuls
openaihttps://api.openai.com/v1OPENAI_API_KEYresponsesAuthorization: Bearer ...
anthropichttps://api.anthropic.comANTHROPIC_API_KEYanthropic-messagesx-api-key: ... + anthropic-version
openrouterhttps://openrouter.ai/api/v1OPENROUTER_API_KEYresponsesAuthorization: Bearer ...
customnonenonenoneDetermined by wire_api

Overrides are rejected for first-class providers

First-class providers (openai, anthropic, openrouter) reject base_url, env_key, and wire_api overrides: each has a fixed endpoint, credential variable, and wire contract. custom is the only way to reach a differently shaped endpoint, and it requires base_url, env_key, and wire_api all explicitly.

base_url semantics

tuls appends the wire endpoint to base_url.

For Responses:

text
base_url + /responses

Examples:

text
https://api.openai.com/v1       -> https://api.openai.com/v1/responses
https://openrouter.ai/api/v1    -> https://openrouter.ai/api/v1/responses

For Anthropic Messages:

text
base_url + /v1/messages

Example:

text
https://api.anthropic.com -> https://api.anthropic.com/v1/messages

Do not duplicate /v1

Do not include /v1 in a custom Anthropic-style base_url unless the target API specifically expects a duplicated path segment.

Custom Responses-compatible provider

Use this only for an endpoint that implements the OpenAI Responses API shape used by tuls. Chat Completions compatibility alone is not sufficient.

toml
model_provider = "custom"
model = "vendor/model"
base_url = "https://gateway.example/api/v1"
env_key = "GATEWAY_API_KEY"
wire_api = "responses"

The credential is sent as:

text
Authorization: Bearer <credential>

Responses runs are stateless: every turn replays the full conversation history as request input, instructions are sent as a developer item, and store: false is set on each request.

Custom Anthropic-Messages-compatible provider

toml
model_provider = "custom"
model = "vendor-model"
base_url = "https://gateway.example"
env_key = "GATEWAY_API_KEY"
wire_api = "anthropic-messages"

The credential is sent with the Anthropic-style headers used by the runtime. This mode is suitable only when the gateway accepts that authentication and Messages API contract.

Provider secrets

Do not put provider API keys into an agent TOML/Markdown file.

This is intentionally invalid:

toml
api_key = "secret"

Use an environment-variable name instead:

toml
env_key = "OPENROUTER_API_KEY"

and provide the secret to the tuls agents process:

bash
export OPENROUTER_API_KEY='...'
tuls agents . --allow agents.run

Related

MIT licensed · built for MCP 2026-07-28