From 9f8719929dbd1326d9b327885c4da319c6d2673c Mon Sep 17 00:00:00 2001 From: t Date: Mon, 15 Jun 2026 17:08:00 -0600 Subject: anthropic credentials in oauth providers (eg copilot) --- libpanto/src/config.zig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libpanto/src/config.zig') diff --git a/libpanto/src/config.zig b/libpanto/src/config.zig index 7c8a495..f2f04e7 100644 --- a/libpanto/src/config.zig +++ b/libpanto/src/config.zig @@ -122,6 +122,11 @@ pub const AnthropicMessagesConfig = struct { /// between tool calls. Ignored when `thinking == .adaptive` (interleaving /// is automatic there) or `.disabled`. thinking_interleaved: bool = false, + /// Use `Authorization: Bearer ...` instead of `x-api-key`. This is set + /// by the embedder from the configured auth family (not guessed from the + /// base URL): standard Anthropic uses `false`, while OAuth-backed + /// Anthropic-compatible providers such as Copilot set `true`. + use_bearer_auth: bool = false, /// Place one `cache_control` breakpoint on the last cacheable block of /// each request, replicating Anthropic's "automatic caching" (a single /// advancing breakpoint) via the broadly-supported per-block marker @@ -344,6 +349,7 @@ test "ProviderConfig - anthropic_messages variant" { try t.expectEqual(APIStyle.anthropic_messages, cfg.style()); try t.expectEqualStrings("2023-06-01", cfg.anthropic_messages.api_version); try t.expectEqual(@as(u32, 64_000), cfg.anthropic_messages.max_tokens); + try t.expectEqual(false, cfg.anthropic_messages.use_bearer_auth); try t.expectEqual(Thinking.disabled, cfg.anthropic_messages.thinking); try t.expectEqual(Effort.medium, cfg.anthropic_messages.effort); try t.expectEqual(@as(?u32, 32_000), cfg.anthropic_messages.thinking_budget_tokens); -- cgit v1.3