Skills

claude-api: connect Claude through the official SDK, and skip deprecated parameters first

For people wiring Claude API into a project. Use the official Anthropic SDK for the current language, default to claude-opus-5 and adaptive thinking, and do not send budget_tokens, which returns 400.

Official source · claude-api

Install

Call Claude through the official Anthropic SDK for the project's language

Who it's for

claude-api is for people whose prompt names Claude or Anthropic and who need a reference on models, parameters, streaming, tools, or caching. It is a Claude API / Anthropic SDK reference, not another installer. When a prompt names Claude/Anthropic in any form, read this guide first; do not skip it because it “looks like one sentence.”

The tighter fit: you will add or change a Claude call in an existing project, and that project language already has an official Anthropic SDK. The guide requires: when you implement a Claude feature, you must call through that language's official SDK. It does not fit people who only want to invent unspecified-SDK pseudocode, or who treat the page path as an install command.

The default model is written as Claude Opus 5; the exact string is claude-opus-5. Slightly complex requests default to adaptive thinking. The guide gives no install command. If the current assistant cannot yet change code from this reference, the existing guide stops here; do not reverse-engineer a skill directory from the address.

First try in 3 minutes

The official first path is to check or change one call from the reference, not to install. The guide page is

https://raw.githubusercontent.com/anthropics/skills/main/skills/claude-api/SKILL.md

Follow only the constraints on that page. Do not write an install phrase that never appears, and do not put secret placeholders into code.

Prerequisite: the current assistant can already work as claude-api, you have a disposable call snippet or empty function, and this machine already has the official Anthropic SDK for that language. There is no install command, so the “location” is this project code, not a guessed skill directory.

Low-risk first task: do a read-only check first. Have the assistant look at whether the existing call goes through the official SDK, whether the model is claude-opus-5, whether thinking is adaptive, and whether the deprecated budget_tokens is present. Do not send a long request to a real account first. Success signal: the assistant points out any of those four deviations and stops for your confirmation before changing code.

If a change is needed, change only the model string and the thinking shape: thinking: {type: "adaptive"}. The guide says that on Claude 4.6+ budget_tokens is deprecated, and on Opus 4.6 / Sonnet 4.6 it is rejected and returns 400. When you see a write prompt, confirm first that no secret is being written into the repository.

Use cases

Case 1: Add a Claude feature to a project. When the prompt names Claude/Anthropic, read the reference first. Implement through the official Anthropic SDK for the project language, use claude-opus-5, and default slightly complex requests to adaptive thinking. This fits when you have already chosen the language and only need the call written correctly. The existing sentences expand only the “official SDK” path and do not name other SDKs; do not switch to an unnamed wrapper. The reference page is

https://raw.githubusercontent.com/anthropics/skills/main/skills/claude-api/SKILL.md

Case 2: Remove an old thinking parameter that returns 400. On Claude 4.6+ use thinking: {type: "adaptive"}; budget_tokens is deprecated on Opus 4.6 / Sonnet 4.6, is rejected, and returns 400. This fits when you just copied a thinking config from an old example and the request immediately returned 400. Change only this spot first, then decide whether to send a real request. The guide does not list every deprecated field, so you can only confirm this one budget_tokens item.

Boundaries

No install command: do not treat the page path as an installer. Trigger boundary: when a prompt names Claude/Anthropic in any form, read first; do not skip it as one sentence. Call boundary: implementing a feature must go through the official Anthropic SDK for the project language; the existing sentences do not expand other parallel methods. Model boundary: default Claude Opus 5, string claude-opus-5; complex requests default to adaptive thinking. Parameter boundary: budget_tokens returns 400 on the named 4.6 models. Secret boundary: do not write secret placeholders or put secrets into code. This reference also covers pricing, streaming, tools, and similar topics, but the existing sentences do not give step-by-step examples for those topics.