claude
Call Claude models through RunAPI using the Anthropic Messages protocol. Use for Claude chat, streaming, vision, tools, reasoning, token counting, or an existing compatibility clie…
RunAPI
@runapi-ai
What This Skill Does
Call the Claude API (claude-opus, claude-sonnet, claude-haiku) through RunAPI using the official Anthropic SDK, OpenAI SDK, Gemini contents clients, or any compatible HTTP client. Supports non-streaming and streaming messages, multimodal vision input, tool use, extended thinking, and token counting.
Replaces managing separate API keys and base URLs for each Claude model by routing all requests through a single RunAPI endpoint with minimal client configuration.
When to Use It
- Send a chat message to Claude and receive a text response
- Stream a long Claude response token-by-token for real-time display
- Analyze an image by sending a multimodal request with image URL or base64 data
- Use Claude's tool/function calling capabilities in an application
- Count input and output tokens for a Claude request without generating a response
- Point an existing OpenAI SDK or Gemini SDK client at Claude models by changing the base URL
Install
$ openclaw skills install @runapi-ai/runapi-claudeClaude 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 ID | Use when |
|---|---|
claude-fable-5 | Flagship state-of-the-art coding, reasoning, and vision |
claude-sonnet-5 | Near-Opus coding at Sonnet cost |
claude-opus-5 | Latest Opus frontier reasoning |
claude-opus-4-8 | Strongest general model |
claude-opus-4-7 | Previous Opus generation |
claude-opus-4-6 | High-end reasoning |
claude-sonnet-4-6 | Balanced reasoning and speed |
claude-opus-4-5-20251101 | Dated Opus 4.5 snapshot |
claude-sonnet-4-5-20250929 | Dated Sonnet 4.5 snapshot |
claude-haiku-4-5-20251001 | Fastest lightweight snapshot |
claude-opus-4-1-20250805 | Dated Opus 4.1 snapshot |
References
Top skills in this category
Humanizer
@biostartechnologyRemove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.
Answer Overflow
@rhyssullivanSearch indexed Discord community discussions via Answer Overflow. Find solutions to coding problems, library issues, and community Q&A that only exist in Discord conversations.
Video Subtitles
@ngutmanGenerate SRT subtitles from video/audio with translation support. Transcribes Hebrew (ivrit.ai) and English (whisper), translates between languages, burns subtitles into video. Use for creating captions, transcripts, or hardcoded subtitles for WhatsApp/social media.
Moltbot Best Practices
@nextfrontierbuildsBest practices for AI agents - Cursor, Claude, ChatGPT, Copilot. Avoid common mistakes. Confirms before executing, drafts before publishing. Vibe-coding essential.
Zero Trust
@doonotSecurity-first behavioral guidelines for cautious agent operation. Use this skill for ALL operations involving external resources, installations, credentials, or actions with external effects. Triggers on - any URL/link interaction, package installations, API key handling, sending emails/messages, social media posts, financial transactions, or any action that could expose data or have irreversible effects.