Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
API 키 설정
API 키를 환경 변수로 내보냅니다. 아래 cURL 명령은 $ANTHROPIC_API_KEY에서 이를 읽습니다.
export ANTHROPIC_API_KEY="your-api-key-here"첫 API 호출하기
Messages API에 POST 요청을 보냅니다:
curl https://api.anthropic.com/v1/messages \
-H "content-type: application/json" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-opus-4-8",
"max_tokens": 1000,
"messages": [
{
"role": "user",
"content": "What should I search for to find the latest developments in renewable energy?"
}
]
}'Claude는 어시스턴트의 메시지를 포함하는 JSON 응답을 반환합니다:
{
"id": "msg_013mHbppMPd2PrVJzGMZPt2D",
"type": "message",
"role": "assistant",
"model": "claude-opus-4-8",
"content": [
{
"type": "text",
"text": "Here are some effective search strategies to find the latest developments in renewable energy:\n\n## General Search Terms\n- \"Renewable energy news 2025\"\n- ..."
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 21,
"output_tokens": 305
}
}첫 API 호출을 완료했습니다. 다음으로, 모든 Claude 통합에서 사용하게 될 Messages API 패턴을 알아보세요.
멀티턴 대화, 시스템 프롬프트, 중지 이유 및 기타 핵심 패턴을 알아보세요.
기본 사항에 익숙해지면 더 자세히 살펴보세요:
기능과 비용별로 Claude 모델을 비교하세요.
도구, 컨텍스트 관리, 구조화된 출력 등 모든 Claude 기능을 살펴보세요.
Python, TypeScript, C# 및 기타 클라이언트 라이브러리에 대한 참조 문서입니다.
Was this page helpful?