Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ pub const DEFAULT_PROFILE: &str = "default";
pub const DEFAULT_PRESET: &str = "@preset/coding-stack";
/// Documented gateway auto preset. Never invent a catalog SKU for this slot.
pub const DEFAULT_MODEL: &str = "anyrouter/auto";
pub const DEFAULT_CLAUDE_HAIKU: &str = "anthropic/claude-haiku-4.5";
pub const DEFAULT_CLAUDE_SONNET: &str = "anthropic/claude-sonnet-4.6";
pub const DEFAULT_CLAUDE_OPUS: &str = "anthropic/claude-opus-4.6";
pub const DEFAULT_CLAUDE_FABLE: &str = "anthropic/claude-fable-5";
/// Free-tier defaults: work for a brand-new account (no credits, no BYOK).
/// Switch with `--model` or `anyr models use`. Keep as string literals; the
/// anyrouter repo check parses them.
pub const DEFAULT_CLAUDE_HAIKU: &str = "anyrouter/free";
pub const DEFAULT_CLAUDE_SONNET: &str = "anyrouter/free";
pub const DEFAULT_CLAUDE_OPUS: &str = "anyrouter/free";
pub const DEFAULT_CLAUDE_FABLE: &str = "anyrouter/free";

#[derive(Debug, Clone, PartialEq)]
pub enum YamlValue {
Expand Down
8 changes: 4 additions & 4 deletions src/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::config::{
Profile, YamlValue, DEFAULT_BASE_URL, DEFAULT_MODEL, DEFAULT_PRESET, DEFAULT_TIMEOUT_MS,
};

pub const PI_DEFAULT_MODEL: &str = "anthropic/claude-sonnet-4.6";
pub const PI_DEFAULT_MODEL: &str = "anyrouter/free";
/// Historical 1M-context suffix used by Claude Code. Claude Code used to strip
/// it before the gateway, but third-party catalog ids (e.g.
/// `meituan/longcat-2.0`) are forwarded verbatim to the provider and 404 on
Expand Down Expand Up @@ -1174,16 +1174,16 @@ mod tests {
);
assert_eq!(
env.get("ANTHROPIC_DEFAULT_HAIKU_MODEL").map(String::as_str),
Some("anthropic/claude-haiku-4.5")
Some("anyrouter/free")
);
assert_eq!(
env.get("ANTHROPIC_DEFAULT_SONNET_MODEL")
.map(String::as_str),
Some("anthropic/claude-sonnet-4.6")
Some("anyrouter/free")
);
assert_eq!(
env.get("ANTHROPIC_DEFAULT_OPUS_MODEL").map(String::as_str),
Some("anthropic/claude-opus-4.6")
Some("anyrouter/free")
);
}

Expand Down
8 changes: 4 additions & 4 deletions tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -706,15 +706,15 @@ fn claude_dry_run_with_key_prints_base_and_redacts_secret() {
"{stdout}"
);
assert!(
stdout.contains("ANTHROPIC_DEFAULT_HAIKU_MODEL=anthropic/claude-haiku-4.5"),
stdout.contains("ANTHROPIC_DEFAULT_HAIKU_MODEL=anyrouter/free"),
"{stdout}"
);
assert!(
stdout.contains("ANTHROPIC_DEFAULT_SONNET_MODEL=anthropic/claude-sonnet-4.6"),
stdout.contains("ANTHROPIC_DEFAULT_SONNET_MODEL=anyrouter/free"),
"{stdout}"
);
assert!(
stdout.contains("ANTHROPIC_DEFAULT_OPUS_MODEL=anthropic/claude-opus-4.6"),
stdout.contains("ANTHROPIC_DEFAULT_OPUS_MODEL=anyrouter/free"),
"{stdout}"
);
assert!(!stdout.contains(key), "full key leaked:\n{stdout}");
Expand Down Expand Up @@ -963,7 +963,7 @@ fn claude_dry_run_haiku_flag_overrides_alias() {
"{stdout}"
);
assert!(
stdout.contains("ANTHROPIC_DEFAULT_SONNET_MODEL=anthropic/claude-sonnet-4.6"),
stdout.contains("ANTHROPIC_DEFAULT_SONNET_MODEL=anyrouter/free"),
"{stdout}"
);
}
Expand Down
Loading