Skip to content
Trending 2026→One of the top-searched agent skills of 2026.

// Build production-grade Claude API apps with prompt caching, tool use, streaming, and model migration baked in.

Claude API Helper

skill --stat
  • last update

    May 27, 2026

  • license

    MITv1.0.0

  • format

    SKILL.md

quickstart.sh
3 steps
  1. Install

    // Downloads SKILL.md into ~/.claude/skills/claude-api-helper/

    $ curl -fsSL --create-dirs -o ~/.claude/skills/claude-api-helper/SKILL.md https://claudeskil.com/skills/claude-api-helper/SKILL.md
  2. Invoke

    // Inside Claude Code, type the skill name as a slash command

    > /claude-api-helper scaffold a typed REST endpoint
  3. Or just ask

    // Claude loads the skill by itself when a request matches its description

    > scaffold a typed REST endpoint
claude-api-helper/
references
SKILL.md
readonly
name:
Claude API Helper
slug:
claude-api-helper
version:
v1.0.0
license:
MIT
author:
@chiragthummar16
categories:
tags:
#claude-api#anthropic-sdk#prompt-caching#tool-use#streaming
description:

Build production-grade Claude API apps with prompt caching, tool use, streaming, and model migration baked in.

features.md
4 capabilities

// What you can do with it

  • Prompt caching — enforces the prefix-match invariant: stable content first (tools → system → messages), cachecontrol: {type: "ephemeral"} on the last shared block, volatile content (timestamps, UUIDs)
  • Tool use — client.beta.messages.toolRunner with betaZodTool (TS) or @betatool (Python) for the automatic loop, or a manual loop that appends full response.content and handles stopreason: "pauseturn".
  • Streaming — .stream() with .getFinalMessage() / .getfinalmessage(), the contentblockdelta event taxonomy, and a default of max_tokens ~64000 for streamed requests (~16000 non-streaming to dodge HTTP t
  • Model migration — confirms scope first, classifies each file (caller vs. registry vs. opaque string), then applies the per-version breaking-change checklist: budgettokens → thinking: {type: "adaptive"

README.md

claude-api-helper/README.md
6 sections

Claude API Helper

A coding-assistant skill that makes you write correct Claude API code instead of plausible-looking code that 400s. It carries the current model catalog, the real request shapes for prompt caching, tool use, streaming, and structured outputs, and a step-by-step migration guide between model versions. For anyone building on the Anthropic SDK (Python, TypeScript, Go, Java, Ruby, C#, PHP) or raw HTTP who is tired of hallucinated parameters and stale defaults.

When to use it

  • Wiring up messages.create / messages.stream and unsure of the current parameter shape
  • Adding prompt caching and your cache_read_input_tokens keeps coming back zero
  • Setting up tool use (tool runner vs. manual loop), server-side tools, or structured outputs
  • Migrating code from Sonnet 4.5 → 4.6, or Opus 4.6 → 4.7 → 4.8, without breaking on removed parameters
  • Debugging refusals, pause_turn, truncated output, or "why won't my cache hit"

What it does

It reads your project to detect the language, then applies accurate, version-aware patterns:

  • Prompt caching — enforces the prefix-match invariant: stable content first (tools → system → messages), cache_control: {type: "ephemeral"} on the last shared block, volatile content (timestamps, UUIDs) after the last breakpoint. It audits for silent invalidators like Date.now() in the system prompt and verifies via usage.cache_read_input_tokens.
  • Tool use — client.beta.messages.toolRunner with betaZodTool (TS) or @beta_tool (Python) for the automatic loop, or a manual loop that appends full response.content and handles stop_reason: "pause_turn". strict: true goes on the tool, not tool_choice; parallel tool_result blocks go in one user message.
  • Streaming — .stream() with .getFinalMessage() / .get_final_message(), the content_block_delta event taxonomy, and a default of max_tokens ~64000 for streamed requests (~16000 non-streaming to dodge HTTP timeouts).
  • Model migration — confirms scope first, classifies each file (caller vs. registry vs. opaque string), then applies the per-version breaking-change checklist: budget_tokens → thinking: {type: "adaptive"}, removed temperature/top_p/top_k, dropped assistant prefills, GA beta-header cleanup.

Usage example

bash
curl -fsSL --create-dirs -o ~/.claude/skills/claude-api-helper/SKILL.md https://claudeskil.com/skills/claude-api-helper/SKILL.md
typescript
// What the skill steers you toward — adaptive thinking, effort, cached prefix
const res = await client.messages.create({
  model: "claude-opus-4-8",
  max_tokens: 16000,
  thinking: { type: "adaptive", display: "summarized" },
  output_config: { effort: "high" },
  system: [{ type: "text", text: BIG_PROMPT, cache_control: { type: "ephemeral" } }],
  messages: [{ role: "user", content: "..." }],
});

Tips & gotchas

  • On Opus 4.8/4.7 and Fable 5, budget_tokens and sampling params (temperature, top_p, top_k) 400 — use adaptive thinking + output_config.effort. On Fable 5, even thinking: {type: "disabled"} 400s; omit the field.
  • display defaults to "omitted" on 4.7/4.8 — your streamed thinking text will be empty unless you set "summarized".
  • Minimum cacheable prefix is model-dependent (4096 tokens on Opus 4.8, 2048 on Sonnet 4.6) — shorter prefixes silently won't cache.
  • Use count_tokens against the exact model, never tiktoken (it undercounts Claude by 15–20%).

FAQ

Does it support providers other than the first-party API? Yes — it has the dedicated client classes for Amazon Bedrock (AnthropicBedrockMantle, anthropic.-prefixed IDs), Vertex AI (bare IDs), Claude Platform on AWS, and Foundry, plus a per-feature availability table.

Will it touch my OpenAI/Gemini code? No. It detects non-Anthropic providers and stops rather than rewriting provider-neutral code with Anthropic calls.

Can it migrate a whole repo at once? It asks you to confirm scope first (file, directory, or list) before editing, then runs the version-by-version checklist on each caller.

$ cat reviews/

Reviews

// No reviews yet. Be the first.
Loading review form…

$ ls related/

explore all →