Documentation Index
Fetch the complete documentation index at: https://docs.apigo.ai/llms.txt
Use this file to discover all available pages before exploring further.
권장 엔드포인트
최소한의 요청
{
"model": "claude-sonnet-4-20250514",
"max_tokens": 1024,
"system": "You are a concise assistant.",
"messages": [
{
"role": "user",
"content": [{ "type": "text", "text": "Summarize ApiGo in three sentences." }]
}
]
}
cURL 예
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4-20250514",
"max_tokens": 1024,
"system": "You are a concise assistant.",
"messages": [
{
"role": "user",
"content": [{ "type": "text", "text": "Summarize ApiGo in three sentences." }]
}
]
}'
파이썬 예제
from anthropic import Anthropic
client = Anthropic(api_key="<ANTHROPIC_API_KEY>")
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
system="You are a concise assistant.",
messages=[
{
"role": "user",
"content": [{"type": "text", "text": "Summarize ApiGo in three sentences."}],
}
],
)
print(response.content[0].text)
Node.js 예
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY,
});
const response = await client.messages.create({
model: "claude-sonnet-4-20250514",
max_tokens: 1024,
system: "You are a concise assistant.",
messages: [
{
role: "user",
content: [{ type: "text", text: "Summarize ApiGo in three sentences." }]
}
]
});
console.log(response.content[0].text);
모범 사례
system는 messages의 일부가 아닌 최상위 수준입니다.
- 순수 텍스트 채팅의 경우에도 Claude의 블록 구조를 유지합니다.
- 실수로 잘림을 방지하려면
max_tokens를 명시적으로 설정하세요.