← ClaudeAtlas

claudelisted

Call the Claude API (claude-opus, claude-sonnet, claude-haiku) through RunAPI using the official Anthropic SDK or any Anthropic-compatible client. Use when the user asks for Claude / Anthropic chat, streaming messages, multimodal vision input, tool use, extended thinking, or token counting, or when they want to point an existing Anthropic SDK setup at RunAPI as the base URL.
runapi-ai/claude · ★ 0 · AI & Automation · score 78
Install: claude install-skill runapi-ai/claude
# Claude on RunAPI Use the official **Anthropic SDK** (Python, TypeScript, Ruby) — or any Anthropic-compatible HTTP client — and switch the base URL to `https://runapi.ai`. The endpoint speaks the Anthropic Messages protocol (`POST /v1/messages`), so no client code changes beyond `base_url` and `api_key`. ## Setup ```dotenv ANTHROPIC_API_KEY=YOUR_RUNAPI_TOKEN ANTHROPIC_BASE_URL=https://runapi.ai ``` Get a RunAPI API Key at <https://runapi.ai/api_keys>. | Language | Init | |---|---| | Python | `anthropic.Anthropic(api_key=..., base_url="https://runapi.ai")` | | TypeScript | `new Anthropic({ apiKey: ..., baseURL: "https://runapi.ai" })` | | Ruby | `Anthropic::Client.new(api_key: ..., base_url: "https://runapi.ai")` | | curl | `POST https://runapi.ai/v1/messages` with `x-api-key:` header | `x-api-key` and `Authorization: Bearer ...` both work; the SDK uses `x-api-key` by default. ## Core recipe — non-streaming message ```python import anthropic client = anthropic.Anthropic( api_key="YOUR_RUNAPI_TOKEN", base_url="https://runapi.ai", ) message = client.messages.create( model="claude-sonnet-4-6", max_tokens=1024, system="You are a helpful assistant.", messages=[{"role": "user", "content": "Explain quantum computing simply."}], ) print(message.content[0].text) print(message.usage) # input_tokens / output_tokens ``` ```typescript import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic({ apiKey: "YOUR_RUNAPI_TOKEN", baseURL: "ht