Sozdai LogoDocs
문서/LLM

Claude Haiku 4.5

200K context프롬프트 캐싱사고
POSThttps://api.foxwire.ai/v1/chat/completions

#Pricing Summary

#요청 예시

Execute completions using standard OpenAI SDK formats by pointing base endpoints here.

bash
curl https://api.foxwire.ai/v1/chat/completions \
  -H "Authorization: Bearer $CORRY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-haiku-4-5",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

#응답 예시

표준 OpenAI 호환 채팅 컴플리션 객체입니다. model 필드는 요청한 이름으로 정규화됩니다.

json
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "model": "claude-haiku-4-5",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Hello! How can I help you today?" },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21, "cost": 0.000234, "currency": "USD" }
}

Cost field

usage.cost is the amount charged for this call (in USD); in streaming it arrives on the final chunk that carries usage. OpenAI SDKs ignore this extra field.

#프롬프트 캐싱

캐시 지원 모델에서는 긴 정적 콘텐츠(시스템, 지식 베이스)를 먼저 배치하고 캐시 중단점을 추가하세요. 캐시된 부분은 비용이 최대 1/10까지 낮아질 수 있습니다. 캐시 적중은 응답의 usage 필드에 표시됩니다.

json
{
  "model": "claude-haiku-4-5",
  "messages": [
    {
      "role": "system",
      "content": [
        { "type": "text", "text": "( long static context ... )", "cache_control": { "type": "ephemeral" } }
      ]
    },
    { "role": "user", "content": "your question" }
  ]
}

Prompt Caching Tip

Prompt caching matches request prefixes exactly. Make sure long contexts (e.g. system instructions, developer tools) appear at the start of your message list.

#사고

지원 모델에서는 reasoning_effort(low / medium / high)를 추가하세요. 사고 내용은 응답의 reasoning_content 필드로 반환되며, 사고 토큰은 출력 요금으로 청구됩니다.

json
{
  "model": "claude-haiku-4-5",
  "max_tokens": 2048,
  "reasoning_effort": "high",
  "messages": [{ "role": "user", "content": "your question" }]
}