Skip to content

docs: updates the examples in README to use currently supported models#261

Open
calicube wants to merge 1 commit intoandrewyng:mainfrom
calicube:youkwan/update-readme-examples
Open

docs: updates the examples in README to use currently supported models#261
calicube wants to merge 1 commit intoandrewyng:mainfrom
calicube:youkwan/update-readme-examples

Conversation

@calicube
Copy link

@calicube calicube commented Dec 18, 2025

Summary

Fixes #260
The example code provided in the README uses a specific model version (anthropic:claude-3-5-sonnet-20240620) that has been deprecated by Anthropic as of August 2025. This causes a 404 Not Found error when users attempt to run the quickstart example.

Changes:

  • Updated the models list in the example code to use the latest stable version: anthropic:claude-sonnet-4-5-20250929.

Root Cause

The specific timestamped version 20240620 has been retired from their active API endpoints, leading the Anthropic Python SDK to return a NotFoundError.

# The current error in the log:
anthropic.NotFoundError: Error code: 404 - {
    'type': 'error', 
    'error': {
        'type': 'not_found_error', 
        'message': 'model: claude-3-5-sonnet-20240620'
    }
}

Solution

Update the model strings to use sonnet 4.5 model to ensure the README remains functional for new users.

import aisuite as ai
client = ai.Client()

models = ["openai:gpt-4o", "anthropic:claude-sonnet-4-5-20250929"]

messages = [
    {"role": "system", "content": "Respond in Pirate English."},
    {"role": "user", "content": "Tell me a joke."},
]

for model in models:
    response = client.chat.completions.create(
        model=model,
        messages=messages,
        temperature=0.75
    )
    print(response.choices[0].message.content)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update README setup example: anthropic:claude-3-5-sonnet-20240620 is deprecated

1 participant