Coding

claude

Try it

Call Claude models through RunAPI using the Anthropic Messages protocol. Use for Claude chat, streaming, vision, tools, reasoning, token counting, or an existing compatibility client that needs the conditional reference.

What it does

Use Anthropic Messages at with as the primary protocol.

The skill document

Claude on RunAPI

Use Anthropic Messages at https://runapi.ai with POST /v1/messages as the primary protocol.

Primary protocol recipe

Authenticate

Set ANTHROPIC_API_KEY to a RunAPI API key and ANTHROPIC_BASE_URL to https://runapi.ai. The SDK sends x-api-key; Bearer authentication is also accepted.

Send request

import anthropic
client = anthropic.Anthropic(api_key="YOUR_RUNAPI_TOKEN", base_url="https://runapi.ai")
message = client.messages.create(
    model="claude-sonnet-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Explain this decision."}],
)
print(message.content[0].text)
print(message.usage)

max_tokens is required. For long output, use client.messages.stream(...) and consume stream.text_stream through the terminal event. Add image blocks, function tools, reasoning controls, or token counting only when the current RunAPI contract verifies them for the selected exact model.

Verify result

Require final text, stop_reason, and authoritative usage. A stream is complete only after terminal Usage and message_stop. Token counting estimates input only; actual response Usage remains authoritative.

Stop boundaries

Correct a rejected shape once using the structured error. Retry transport once only before any response or Usage and when replay is safe. Record a terminal error and stop without changing model or protocol.

Compatibility protocols

Load compatibility protocols only when an existing client requires OpenAI Chat/Responses or Gemini contents.

Supported models

Model IDUse when
claude-fable-5Flagship state-of-the-art coding, reasoning, and vision
claude-sonnet-5Near-Opus coding at Sonnet cost
claude-opus-5Latest Opus frontier reasoning
claude-opus-4-8Strongest general model
claude-opus-4-7Previous Opus generation
claude-opus-4-6High-end reasoning
claude-sonnet-4-6Balanced reasoning and speed
claude-opus-4-5-20251101Dated Opus 4.5 snapshot
claude-sonnet-4-5-20250929Dated Sonnet 4.5 snapshot
claude-haiku-4-5-20251001Fastest lightweight snapshot
claude-opus-4-1-20250805Dated Opus 4.1 snapshot

References

Related skills

Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.

by johnpatternai22 installs8 stars

Stores durable facts in a categorized, plain-markdown vault on disk, alongside your agent's built-in memory.

by Iván559 installs18 stars

Generate and edit Draw.io, Mermaid, and Excalidraw diagrams from natural language using a structured JSON spec.

by nssa.io1.0k installs47 stars

Find why your productivity system keeps failing, then apply the smallest fix — capacity math, bottleneck routing, durable local notes.

by Iván855 installs69 stars

Fetch raw ad creative, app, ranking, and revenue data from AdMapix as structured JSON.

by fly0pants4.3k installs296 stars

Run Git operations — commits, branches, merges, rebases, conflict resolution, and recovery — with safety rules enforced.

by Iván535 installs31 stars

More from runapi-ai

Browse all skills

Generate, extend, and transform music or compose lyrics with Suno models via RunAPI's CLI or SDK.

by runapi-ai11 installs

Run one-off RunAPI service commands from the terminal with JSON requests and inspect results synchronously or via polling.

by runapi-ai11 installs

Generate and edit images with GPT Image through RunAPI. Use when the user asks an agent to create, edit, or transform images with GPT Image. Default to the RunAPI CLI for one-off generation; use SDKs only when the user is integrating RunAPI into an app or backend.

by runapi-ai13 installs

Generate speech, dialogue, and sound with ElevenLabs through RunAPI. Use when the user asks an agent to create speech, dialogue, or sound effects, or transcribe audio with ElevenLabs. Default to the RunAPI CLI for one-off generation; use SDKs only when the user is integrating RunAPI into an app or backend.

by runapi-ai12 installs

Generate and edit images with Flux Kontext through RunAPI. Use when the user asks an agent to create, edit, or transform images with Flux Kontext. Default to the RunAPI CLI for one-off generation; use SDKs only when the user is integrating RunAPI into an app or backend.

by runapi-ai12 installs

Generate and edit images with GPT Image 2 through RunAPI. Use when the user asks an agent to create, edit, or transform images with GPT Image 2. Default to the RunAPI CLI for one-off generation; use SDKs only when the user is integrating RunAPI into an app or backend.

by runapi-ai12 installs