Claude API
Anthropic's LLM for complex reasoning, code, analysis, and extended-context tasks.
# Base URL
https://runapi.ai
# Endpoints
POST /v1/chat/completions
POST /v1/responses
POST /v1/messages
POST /v1beta/models/{model}:generateContent
POST /v1beta/models/{model}:streamGenerateContent
curl https://runapi.ai/v1/messages \
-H "Authorization: Bearer $RUNAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Review this pull request for security vulnerabilities, performance issues, and suggest concrete improvements."
}
]
}'
import anthropic
client = anthropic.Anthropic(
base_url="https://runapi.ai",
api_key="your-runapi-key"
)
message = client.messages.create(
model="claude-sonnet-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Review this pull request for security vulnerabilities, performance issues, and suggest concrete improvements."}]
)
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://runapi.ai",
apiKey: "your-runapi-key"
});
const message = await client.messages.create({
model: "claude-sonnet-5",
max_tokens: 1024,
messages: [{ role: "user", content: "Review this pull request for security vulnerabilities, performance issues, and suggest concrete improvements." }]
});
Claude is Anthropic's large language model family available in Opus, Sonnet, and Haiku tiers, designed for nuanced reasoning, long-context analysis, and code generation. It emphasizes accuracy, instruction following, and predictable outputs.
- Più varianti per diversi livelli di velocità / qualità
- Il model skill include documentazione, schema e note di setup
- Funziona con workflow di sviluppo app
- Le generazioni fallite non vengono addebitate
Confronta tutte le varianti API
| Variant | Billing | From | |
|---|---|---|---|
| claude-fable-5 | 1K tokens | $0.250 | Visualizza → |
| claude-haiku-4-5-20251001 | 1K tokens | $0.030 | Visualizza → |
| claude-opus-4-1-20250805 | 1K tokens | $0.380 | Visualizza → |
| claude-opus-4-5-20251101 | 1K tokens | $0.130 | Visualizza → |
| claude-opus-4-6 | 1K tokens | $0.130 | Visualizza → |
| claude-opus-4-7 | 1K tokens | $0.130 | Visualizza → |
| claude-opus-4-8 | 1K tokens | $0.130 | Visualizza → |
| claude-opus-5 | 1K tokens | $0.130 | Visualizza → |
| claude-sonnet-4-5-20250929 | 1K tokens | $0.080 | Visualizza → |
| claude-sonnet-4-6 | 1K tokens | $0.080 | Visualizza → |
| claude-sonnet-5 | 1K tokens | $0.050 | Visualizza → |
Endpoint API Claude
Usa l'SDK OpenAI o Anthropic con la tua chiave RunAPI. Nessun SDK aggiuntivo necessario.
| Endpoint | Protocol |
|---|---|
| /v1/chat/completions | OpenAI compatible |
| /v1/responses | OpenAI Responses |
| /v1/messages | Anthropic compatible |
| /v1beta/models/{model}:generateContent | Gemini generateContent |
| /v1beta/models/{model}:streamGenerateContent | Gemini streamGenerateContent |
Dal model skill al primo risultato in quattro passaggi
Scegli il modello
Seleziona modello e variante adatti al tipo di output, al livello qualità e alla latenza target.
Configura
Imposta la tua chiave RunAPI e installa il model skill nel workspace di codice.
Implementa
Usa le istruzioni dello skill per aggiungere la feature modello dentro la tua applicazione.
Ricevi
Interroga per task ID, usa streaming dove supportato o gestisci il callback webhook.
Che cos'è l'API Claude?
Claude is Anthropic's LLM family, spanning Opus (frontier), Sonnet (balanced), and Haiku (fast). Through RunAPI, all Claude variants share the same API shape and per-token billing.
Perché usare l'API Claude tramite RunAPI
Un’unica autenticazione, tutti i provider
Una sola chiave RunAPI sblocca l’intero catalogo. Niente account separati, niente rotazione delle chiavi per integrazione.
Prezzi e billing unificati
Prezzi per chiamata in USD, fatturati mensilmente. Le generazioni fallite non vengono addebitate.
Skill con schema
Schema tipizzati e note di setup sono inclusi nel model skill, così l'implementazione parte dal contratto corretto.
Domande frequenti
What is the context window size?
Most Claude models support 200K tokens of context, with 1M-token context available on the latest Opus and Sonnet models. Pricing is the same per-token regardless of context size.
What is extended thinking?
Extended thinking lets Claude reason step-by-step before answering. Thinking tokens are billed as output tokens and count toward the context limit.
How do Opus, Sonnet, and Haiku compare?
Opus is the most capable for complex reasoning. Sonnet balances quality and speed. Haiku is the fastest and cheapest for high-throughput tasks.
Does Claude support tool use?
Yes — Claude can call tools, execute code, search the web, and fetch URLs. Tool use is generally available with no beta header required.
Is prompt caching available?
Yes — cache reads are charged at roughly 10% of the standard input rate, significantly reducing cost for repeated contexts.
Da quale variante dovrei iniziare?
Scegli la variante più economica che soddisfa il tuo livello di qualità. La maggior parte dei team inizia con la variante veloce e passa alla pro per la produzione.
C’è un piano gratuito?
I nuovi account ricevono le prime chiamate gratuite su ogni modello. Dopo, paghi per chiamata.
Trasmettete i risultati in streaming?
Dove lo streaming è disponibile, RunAPI trasmette end-to-end.
Come vengono addebitati i fallimenti?
Le generazioni non riuscite non vengono addebitate.
Gli output vengono memorizzati nella cache?
Gli output generati vengono salvati e recuperabili tramite ID del task. Gli input non vengono memorizzati nella cache.
Posso usarlo a fini commerciali?
Sì — l’uso commerciale è incluso per ogni variante, salvo che una licenza del modello lo limiti esplicitamente; in tal caso è indicato nella pagina della variante.
E i limiti di rate limit?
I rate limit per chiave scalano in base al tier di utilizzo. Vedi la pagina prezzi per i limiti aggiornati.
Dove posso segnalare problemi?
Apri un issue nel repo GitHub pubblico oppure scrivi al supporto.