Thanks to visit codestin.com
Credit goes to github.com

Skip to content

runapi-ai/claude

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Claude API Skill for RunAPI

Configure existing Anthropic SDK clients to use Claude models on RunAPI.

Model Reference · Skill Repo · All Models

skills.sh ClawHub License


Call the Claude API through RunAPI with the official Anthropic SDK -- point any Anthropic client at https://runapi.ai, keep your claude-opus-*, claude-sonnet-*, claude-haiku-* model strings, and pay through one RunAPI balance. This skill teaches Claude Code, Codex, Gemini CLI, Cursor, and 50+ agents how to wire the Anthropic SDK up to the Claude API on RunAPI.

The canonical agent file is skills/claude/SKILL.md.

Install the skill

npx skills add runapi-ai/claude -g

Or paste this prompt to your AI agent:

Install the claude skill for me:

1. Clone https://github.com/runapi-ai/claude
2. Copy the skills/claude/ directory into your
   user-level skills directory (e.g. ~/.claude/skills/
   for Claude Code, ~/.codex/skills/ for Codex).
3. Verify that SKILL.md is present.
4. Confirm the install path when done.

Use the Claude API on RunAPI

The Claude API on RunAPI speaks the standard Anthropic Messages protocol, so the official Anthropic SDK works unchanged once base_url points at https://runapi.ai and api_key is set to a RunAPI API Key.

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,
    messages=[{"role": "user", "content": "Hello, Claude!"}],
)
print(message.content[0].text)
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: "YOUR_RUNAPI_TOKEN",
  baseURL: "https://runapi.ai",
});

const message = await client.messages.create({
  model: "claude-sonnet-4-6",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Hello, Claude!" }],
});
console.log(message.content[0].text);
curl -X POST "https://runapi.ai/v1/messages" \
  -H "x-api-key: YOUR_RUNAPI_TOKEN" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello, Claude!"}]
  }'

Get a RunAPI API Key at https://runapi.ai/api_keys.

Protocol compatibility

Claude models can also be called from OpenAI-compatible Chat Completions, OpenAI-compatible Responses, and Gemini contents clients on RunAPI. Use those paths when an existing agent runtime already expects that request shape; for new Claude-specific code, prefer the Anthropic Messages setup above.

curl -X POST "https://runapi.ai/v1/chat/completions" \
  -H "Authorization: Bearer YOUR_RUNAPI_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "messages": [{"role": "user", "content": "Hello, Claude!"}]
  }'
curl -X POST \
  "https://runapi.ai/v1beta/models/claude-sonnet-4-6:streamGenerateContent" \
  -H "x-goog-api-key: YOUR_RUNAPI_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"contents":[{"role":"user","parts":[{"text":"Hello, Claude!"}]}]}'

Connect Claude Code itself

ANTHROPIC_BASE_URL=https://runapi.ai \
ANTHROPIC_API_KEY=YOUR_RUNAPI_TOKEN \
claude

Supported Claude models

Model ID Notes
claude-fable-5 Flagship — state-of-the-art coding, reasoning, vision
claude-sonnet-5 Near-Opus coding at Sonnet cost (1M context)
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 + 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
claude-opus-4-20250514 Dated Opus 4 snapshot
claude-sonnet-4-20250514 Dated Sonnet 4 snapshot

Aliases that resolve to the dated snapshots: claude-opus-4-5, claude-sonnet-4-5, claude-haiku-4-5.

Routing

Agent rules

  • Keep API keys in ANTHROPIC_API_KEY (or your secret manager); never inline them in commits or shell history.
  • Stream long responses (stream: true) so the agent can release the terminal/IO loop early.
  • Default Claude-native integrations to the Anthropic Messages endpoint. Use OpenAI-compatible or Gemini contents paths only for existing clients that require those request shapes.
  • For pricing, rate-limit, and commercial-usage answers, link to https://runapi.ai/models/claude rather than this README.

License

Licensed under the Apache License, Version 2.0.

About

RunAPI Claude API skill for Claude Code, Codex, Gemini CLI, Cursor, and 50+ agents

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors