TokenHub의 통합 /chat/completions 엔드포인트를 통해 Anthropic Claude model을 호출하세요. 요청 및 응답 형식은 완전히 OpenAI-compatible하므로 SDK 이전이 필요 없습니다. Streaming, tool 사용(function calling), vision(이미지 입력)을 모두 지원합니다. 과금은 model 티어별 per-token 기준입니다.
th-xxxxxxxxxxxx...)https://tokenhub.store/api/v1Authorization 헤더에 API Key를 전달하세요:
Authorization: Bearer th-your-api-keyPOST/chat/completions채팅 완료. streaming, tool use, vision, JSON mode를 포함해 OpenAI /v1/chat/completions와 동일한 스키마입니다.
요금은 100만 tokens당 USD 기준입니다. 성공한 호출에만 요금이 부과됩니다. 정식 ID와 anthropic/* 별칭을 모두 지원합니다.
| 티어 | 모델 ID | 입력 | 출력 | 비고 |
|---|---|---|---|---|
| Opus 4.7 | anthropic/claude-opus-4-7 | $5.00 | $25.00 | 최신, 최고 품질의 reasoning 및 coding. |
| Opus 4.6 | anthropic/claude-opus-4-6 | $5.00 | $25.00 | 최신, 최고 품질의 reasoning 및 coding. |
| Sonnet 4.6 | anthropic/claude-sonnet-4-6 | $3.00 | $15.00 | 품질과 비용의 균형이 뛰어난 대표 모델 (권장 기본값). |
| Haiku 4.5 | anthropic/claude-haiku-4-5 | $1.00 | $5.00 | 가장 빠르고 저렴한 4-gen 모델; 고QPS 및 분류 작업에 적합합니다. |
| Sonnet 4.5 | anthropic/claude-sonnet-4-5 | $3.00 | $15.00 | 이전 세대의 범용 작업용 주력 모델. |
| Opus 4.5 | anthropic/claude-opus-4-5 | $5.00 | $25.00 | 최신, 최고 품질의 reasoning 및 coding. |
| Sonnet 4 | anthropic/claude-4-sonnet | $3.00 | $15.00 | 이전 세대의 범용 작업용 주력 모델. |
| Opus 4 | anthropic/claude-4-opus | $15.00 | $75.00 | 최신, 최고 품질의 reasoning 및 coding. |
| 3.5 Sonnet | anthropic/claude-3-5-sonnet-latest | $3.00 | $15.00 | 안정적이며 실전 검증 완료; 폭넓게 호환됩니다. |
| 3.5 Haiku | anthropic/claude-3-5-haiku-latest | $0.80 | $4.00 | 안정적이며 실전 검증 완료; 폭넓게 호환됩니다. |
| 파라미터 | 타입 | 필수 여부 | 기본값 | 설명 |
|---|---|---|---|---|
| model | string | 필수 | — | Claude model ID. 예: "anthropic/claude-sonnet-4-6". anthropic/* 접두사가 있는 형식과 짧은 이름 형식 모두 허용됩니다. |
| messages | array | 필수 | — | 채팅 기록입니다. 각 항목은 { role, content } 형식입니다. role ∈ system | user | assistant. content는 문자열 또는 파트 배열입니다 (vision / tool 결과용). |
| max_tokens | integer | 선택 | 1024 | 최대 출력 tokens (Claude에서는 필수). 일반적으로 1024–4096입니다. |
| temperature | number | 선택 | 1.0 | 샘플링 temperature, 0.0–1.0. 낮을수록 더 결정적입니다. |
| top_p | number | 선택 | 1.0 | 핵심 샘플링입니다. temperature 또는 top_p 중 하나만 사용하세요. 둘 다 사용하지 마세요. |
| stream | boolean | 선택 | false | true이면 Server-Sent Events (SSE) 델타를 반환합니다. |
| stop | string[] | 선택 | — | 최대 4개의 중지 시퀀스를 지정할 수 있습니다. |
| tools | array | 선택 | — | tool use (function calling)을 위한 tool/function 정의 목록입니다. |
| tool_choice | string|object | 선택 | auto | tool 선택을 제어합니다: auto | none | required | { type:'function', function:{ name } }. |
| response_format | object | 선택 | — | JSON mode: { "type": "json_object" } forces the model to return valid JSON. |
| user | string | 선택 | — | 자체 추적용 선택적 최종 사용자 ID입니다. |
curl https://tokenhub.store/api/v1/chat/completions \
-H "Authorization: Bearer th-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-4-6",
"messages": [
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Explain CAP theorem in 3 bullets."}
],
"max_tokens": 512,
"temperature": 0.3
}'from openai import OpenAI
client = OpenAI(
api_key="th-your-api-key",
base_url="https://tokenhub.store/api/v1",
)
resp = client.chat.completions.create(
model="anthropic/claude-sonnet-4-6",
max_tokens=512,
temperature=0.3,
messages=[
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Explain CAP theorem in 3 bullets."},
],
)
print(resp.choices[0].message.content)
print("usage:", resp.usage)import OpenAI from "openai";
const client = new OpenAI({
apiKey: "th-your-api-key",
baseURL: "https://tokenhub.store/api/v1",
});
const resp = await client.chat.completions.create({
model: "anthropic/claude-sonnet-4-6",
max_tokens: 512,
temperature: 0.3,
messages: [
{ role: "system", content: "You are a concise assistant." },
{ role: "user", content: "Explain CAP theorem in 3 bullets." },
],
});
console.log(resp.choices[0].message.content);
console.log("usage:", resp.usage);TokenHub에 가입하고 OpenAI-compatible API로 Claude를 바로 사용해 보세요