Call GPT generation and OpenAI text embedding models through RunAPI using OpenAI-compatible clients. Use for chat, Responses, embeddings, streaming, tools, vision, or an existing compatibility client that needs the conditional reference.
编程
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 client that needs the conditional reference.
它能做什么
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.
技能文档
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 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
相关技能
Call Gemini 2.5 and 3 series models through RunAPI using Gemini contents clients. Use for Gemini chat, streaming, multimodal input, grounding, structured output, reasoning, or an existing compatibility client that needs the conditional reference.
Reference for the ai-assistant API / ai-provider SDK — model ids, pricing, params, streaming, tool use, 工具协议, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; do Use when 需要Development领域自动化处理、数据分析和流程编排时使用。不适用于无明确需求的模糊场景。
Call the Qwen text API (qwen3-next-80b-a3b-instruct) through RunAPI using the official OpenAI SDK or compatible clients. Use when the user asks for Qwen text...
Choose RunAPI SDK packages for application developers building web apps, backends, workers, or libraries. Use when the user asks to integrate RunAPI into code, pick JavaScript/Python/Ruby/Go/Java/PHP packages, or understand core SDK vs Provider Client packages. Do not use for one-off generation or agent-executed media tasks; use the RunAPI CLI or the relevant model skill instead.
Generate and image to images with Qwen 3 through RunAPI. Use when the user asks an agent to create, edit, or transform images with Qwen 3. Default to the RunAPI CLI for one-off generation; use SDKs only when the user is integrating RunAPI into an app or backend.