Skip to content

bug: Some Anthropic (Claude) model names appear deprecated or invalid, resulting in 404 Not Found errors from the Anthropic API #1370

@scadoshi

Description

@scadoshi
  • I have looked for existing issues (including closed) about this

Bug Report

Some of Rig's pre-defined Anthropic model constants (CLAUDE_3_5_SONNET, CLAUDE_3_7_SONNET) resolve to model identifiers that Anthropic's API no longer recognizes, resulting in 404 Not Found errors. This breaks model selection in applications using these constants from rig::providers::anthropic::completion.

Reproduction

Using Rig version 0.29.0, the following code fails when trying to use certain model constants:

use rig::{
    providers::anthropic::completion::{
        CompletionModel, CLAUDE_3_5_HAIKU, CLAUDE_3_5_SONNET, CLAUDE_3_7_SONNET,
        CLAUDE_4_OPUS, CLAUDE_4_SONNET,
    },
};

// In my scotbot CLI project, I build an agent like this:
let client = anthropic::Client::from_env();
let agent = client
    .agent(CLAUDE_3_7_SONNET)  // or CLAUDE_3_5_SONNET
    .preamble("You are a helpful assistant")
    .build();

// When sending a message:
let response = agent
    .chat(Message::user("Hello"), vec![].into())
    .await?;  // ❌ Fails with 404

Working models:

  • CLAUDE_3_5_HAIKU
  • CLAUDE_4_OPUS
  • CLAUDE_4_SONNET

Failing models:

  • CLAUDE_3_5_SONNET
  • CLAUDE_3_7_SONNET

Error message:

Error: CompletionError: HttpError: Invalid status code 404 Not Found with message:
{
  "type":"error",
  "error":{
    "type":"not_found_error",
    "message":"model: claude-3-7-sonnet-latest"
  },
  "request_id":"req_011CXr8vk1U7Q5zvnX4DuK"
}

Expected behavior

Rig's exported model constants should only include models that Anthropic currently supports. When a model is deprecated by Anthropic, the constant should either:

  1. Be removed from Rig
  2. Be updated to point to the correct current model identifier
  3. Be marked as deprecated with a compile-time warning

Additional context

  • Rig version: rig-core = "0.30.0"
  • Rust version: Latest stable (2024 edition)
  • Impact: Users using Rig's pre-defined constants hit runtime 404 errors when selecting these models

Suggestion: Update these constants to use accurate model names that match Anthropic's current API, or remove them if these models are no longer available.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions