Developer documents three fixes needed to run gpt-oss-120b via Anthropic SDK on Sakura AI
A developer testing Sakura Internet's free AI Engine API encountered three consecutive roadblocks while connecting to the gpt-oss-120b model through Anthropic's Python SDK. The free tier, offered by Japanese cloud provider Sakura Internet, allows 3,000 chat completions per month at no charge, and the credit card requested at sign-up serves only as identity verification rather than a billing trigger. A 401 authentication error arose because Anthropic's SDK sends an x-api-key header by default, while Sakura's endpoint expects Bearer token auth, requiring the use of auth_token instead of api_key. A third issue emerged when indexing the response directly at content[0] failed due to a ThinkingBlock object appearing before the text block, which is resolved by filtering response content by type. All three issues have straightforward one-line fixes once their root causes are understood.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in