Skip to content

调用API的“claude-3-7-sonnet-20250219"模型时,发生错误 #385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
leiw5173 opened this issue Apr 24, 2025 · 1 comment
Open

Comments

@leiw5173
Copy link

Describe the bug 描述bug
当我调用API的“claude-3-7-sonnet-20250219"模型时,发生错误
···
anthropic.NotFoundError: Error code: 404 - {'timestamp': 1745485073795, 'status': 404, 'error': 'Not Found', 'path': '//chat/completions/v1/messages'}
···

To Reproduce 复现方法
这是我的代码

from anthropic import Anthropic

client = Anthropic(
    # Enter forwarding API key
    api_key="",
    base_url="https://api.chatanywhere.tech/v1/chat/completions"
)

completion = client.messages.create(
    model="claude-3-7-sonnet-20250219",
    messages=[
        {
            "role": "user",
            "content": "What is the capital of France?"
        }
    ],
    temperature=0.7,
    max_tokens=100,
)

print(completion.choices[0].message.content)
@ynpl
Copy link

ynpl commented Apr 24, 2025

使用openai的调用方式调用就OK啦

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

No branches or pull requests

2 participants