#SDK thinks claude-sonnet-4-5-20250929 doesn't exist

1 messages Ā· Page 1 of 1 (latest)

vestal hazel
#

Still getting 404 - pi-ai is using its bundled v0.71.2
The problem: pi-ai has @anthropic-ai/sdk as a bundled dependency

Request being sent by OpenClaw:

• Model ID: claude-sonnet-4-5-20250929 (dated version)
• API: anthropic-messages via pi-ai library
• Provider: anthropic
Error returned:

404 {"type":"error","error":{"type":"not_found_error","message":"Not Found"},"request_id":"req_011CXd1jiR3n5rjQeDaLs9zj"}

What works (direct curl):

curl -X POST https://api.anthropic.com/v1/messages
-H "x-api-key: sk-ant-api03-..."
-H "anthropic-version: 2023-06-01"
-H "content-type: application/json"
-d '{
"model": "claude-sonnet-4-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello"}]
}'

peak stormBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> āœ… Mark Solution

teal acornBOT
# vestal hazel Still getting 404 - pi-ai is using its bundled v0.71.2 The problem: pi-ai has @a...

Based on my research, this is a version mismatch issue with the pi-ai library's bundled SDK.

The Problem

The pi-ai library is using @anthropic-ai/sdk v0.71.2 which has a bundled/outdated version of the Anthropic API client. This creates two potential issues:

  1. Dated model ID format - claude-sonnet-4-5-20250929 is a snapshot ID that may not be recognized by older SDK versions
  2. API version header mismatch - Older SDKs send different anthropic-version headers

Workarounds

Option 1: Use a direct Anthropic SDK (Recommended)

npm install @anthropic-ai/sdk

Then use the latest SDK directly instead of pi-ai.