You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an issue with the Messages API rather than the SDK: attempting to use an invalid model identifier results in different error messages, depending on the API key being specified.
constresponse=awaitfetch('https://api.anthropic.com/v1/messages',{method: 'POST',headers: {'x-api-key': 'sk-ant-api03-H8yfz...-Q7161AAA','anthropic-version': '2023-06-01',// required by the Messages API},body: JSON.stringify({messages: [{role: 'user',content: 'Hello'}],max_tokens: 4096,// required, maximummodel: 'invalid-model',}),});console.log(awaitresponse.json());
With the API key above, which I obtained from my Anthropic console, I see the following error:
This is an issue with the Messages API rather than the SDK: attempting to use an invalid model identifier results in different error messages, depending on the API key being specified.
With the API key above, which I obtained from my Anthropic console, I see the following error:
With a different API key,
sk-ant-api03-1WH_3x...-ONyGHQAA
, provided by @zack-anthropic, I see a different error message when running the same code:Related: #517
The text was updated successfully, but these errors were encountered: