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.
- Wiele wariantów dla różnych poziomów szybkości i jakości
- Model skill zawiera dokumentację, schematy i notatki setupu
- Działa z workflow kodowania aplikacji
- Nie płacisz za nieudane generacje
Porównaj wszystkie warianty API
| Variant | Billing | From | |
|---|---|---|---|
| claude-fable-5 | 1K tokens | $0.250 | Zobacz → |
| claude-haiku-4-5-20251001 | 1K tokens | $0.030 | Zobacz → |
| claude-opus-4-1-20250805 | 1K tokens | $0.380 | Zobacz → |
| claude-opus-4-5-20251101 | 1K tokens | $0.130 | Zobacz → |
| claude-opus-4-6 | 1K tokens | $0.130 | Zobacz → |
| claude-opus-4-7 | 1K tokens | $0.130 | Zobacz → |
| claude-opus-4-8 | 1K tokens | $0.130 | Zobacz → |
| claude-opus-5 | 1K tokens | $0.130 | Zobacz → |
| claude-sonnet-4-5-20250929 | 1K tokens | $0.080 | Zobacz → |
| claude-sonnet-4-6 | 1K tokens | $0.080 | Zobacz → |
| claude-sonnet-5 | 1K tokens | $0.050 | Zobacz → |
Endpointy API Claude
Użyj SDK OpenAI lub Anthropic z kluczem RunAPI. Dodatkowy SDK nie jest wymagany.
| 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 |
Od model skilla do pierwszego wyniku w czterech krokach
Wybierz model
Wybierz model i wariant pasujące do typu wyjścia, progu jakości i celu opóźnienia.
Konfiguracja
Ustaw klucz RunAPI i zainstaluj model skill w workspace kodu.
Implementacja
Użyj instrukcji skilla, aby dodać funkcję modelu w swojej aplikacji.
Odbiór
Odpytuj po task ID, streamuj gdy wspierane albo obsłuż callback webhook.
Czym jest 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.
Dlaczego używać API Claude przez RunAPI
Jedno uwierzytelnienie, wszyscy providerzy
Jeden klucz RunAPI odblokowuje cały katalog. Bez osobnych kont i rotacji kluczy dla każdej integracji.
Ujednolicony cennik i rozliczenia
Rozliczanie za wywołanie w USD, fakturowane co miesiąc. Nieudane generacje nie są naliczane.
Skill ze schematami
Typowane schematy i notatki setupu są spakowane w model skill, więc implementacja startuje od właściwego kontraktu.
Najczęstsze pytania
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.
Od jakiego wariantu powinienem zacząć?
Wybierz najtańszy wariant, który spełnia Twoje wymagania jakościowe. Większość zespołów zaczyna od szybkiego wariantu, a do produkcji przechodzi na pro.
Czy jest darmowy plan?
Nowe konta otrzymują darmowe pierwsze wywołania dla każdego modelu. Później płacisz za każde wywołanie.
Czy streamujecie wyniki?
Tam, gdzie streaming jest dostępny, RunAPI streamuje end-to-end.
Jak są rozliczane nieudane próby?
Nieudane generacje nie są obciążane opłatą.
Czy wyniki są buforowane?
Wygenerowane wyniki są zapisywane i można je pobrać po ID zadania. Dane wejściowe nie są buforowane.
Czy mogę używać komercyjnie?
Tak — użycie komercyjne jest dostępne dla każdego wariantu, chyba że licencja modelu wyraźnie to ogranicza; informacja taka jest podana na stronie wariantu.
A co z limitami zapytań?
Limity na klucz rosną wraz z poziomem wykorzystania. Aktualne limity znajdziesz na stronie cennika.
Gdzie mogę zgłosić problem?
Otwórz zgłoszenie w publicznym repozytorium GitHub albo napisz do supportu.