1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Embedded provider table (arch §4.2). Parsed through the SAME
# `toml::from_str::<PartialConfig>` path as a user config file — the lowest-
# precedence operand of the resolution fold, never a bootstrap special case
# (config §3.5). A unit test parses this file so a malformed edit fails the
# build, not a user run.
# Transport timeouts in whole seconds (config §4). The single home for these
# numbers — `bz` reads them off the resolved config and stamps the request, so the
# bin holds no magic constants. `timeout_idle` is the INTER-CHUNK bound on the
# streaming body (reset per chunk): it abandons a provider that stalls mid-stream
# without capping total stream length, so a long-but-live generation is never cut.
# Override any of them in your config file / env / flags; delete one to unbound it.
= 30
= 120
= 300
[[]]
= "anthropic"
= "https://api.anthropic.com"
= "anthropic_messages"
= "api_key"
= { = "x-api-key", = "raw" }
= [["anthropic-version", "2023-06-01"]]
= { = 4096 } # Anthropic requires max_tokens; the row's sane default, overridable via config/flag (config §4.1)
= ["claude-"] # owns the claude- family, so `bz -m claude-… "q"` routes here with no --provider (arch §4.3)
= { = "api_key_env", = "ANTHROPIC_API_KEY" } # vendor-conventional key alias as a ROW-SCOPED, store-miss source — below BRAZEN_API_KEY/--api-key, can't leak cross-vendor or shadow a stored cred (auth §5.5)
[[]]
= "openai"
= "https://api.openai.com/v1"
= "openai_chat"
= "bearer"
= { = "Authorization", = "bearer" }
= ["gpt-", "chatgpt-", "o1", "o3", "o4"] # the OpenAI families; openai-responses (same models, other protocol) ships none, so it stays explicit (arch §4.3)
# Mistral speaks the OpenAI chat dialect verbatim — the severability proof: one
# row, ZERO Rust (providers §2). Reuses the OpenAiChat protocol + bearer auth.
[[]]
= "mistral"
= "https://api.mistral.ai/v1"
= "openai_chat"
= "bearer"
= { = "Authorization", = "bearer" }
= ["mistral-", "ministral-", "magistral-", "codestral-", "pixtral-"]
[[]]
= "openai-responses"
= "https://api.openai.com/v1"
= "openai_responses"
= "bearer"
= { = "Authorization", = "bearer" }
# No model_prefixes: openai-responses serves the SAME OpenAI model ids as `openai`
# over a different protocol. Claiming them would make every gpt-… ambiguous (78),
# so this alternate-protocol row stays opt-in via explicit --provider (arch §4.3).
# Google authenticates with a custom header NAME carrying the raw key — pure row
# DATA read by the shared ApiKeyAuth, no new Auth impl (providers §4.1).
[[]]
= "google"
= "https://generativelanguage.googleapis.com"
= "google_generative_ai"
= "api_key"
= { = "x-goog-api-key", = "raw" }
= ["gemini-"]
# Local Ollama needs no auth: `auth = "none"` reads no credential and writes no
# header, so a keyless row carries no `api_header` (providers §5.1).
[[]]
= "ollama"
= "http://localhost:11434"
= "ollama_chat"
= "none"