Token use and costs
기준일: 2026-07-26
공식 기준: Token use and costs
Token use and costs 문서는 OpenClaw 공식 문서(reference/token-use)를 한국어로 정리한 가이드입니다. How OpenClaw builds prompt context and reports token usage + costs 명령·설정 키·코드 예시는 공식 문서를 그대로 보존하며, 해석과 절차 안내는 한국어로 제공합니다. 최종 동작은 설치된 CLI 버전과 공식 원문을 확인하세요.
핵심 요약
How OpenClaw builds prompt context and reports token usage + costs
한국어 가이드 범위: reference/token-use 경로의 설정·명령·제약·예시를 학습용으로 재구성합니다.
문서 구성
공식 문서의 주요 섹션은 다음과 같습니다.
- How the system prompt is built
- What counts in the context window
- How to see current token usage
- Cost estimation (when shown)
- Cache TTL and pruning impact
- Example: keep 1h cache warm with heartbeat
- Example: mixed traffic with per-agent cache strategy
- Anthropic 1M context
- Tips for reducing token pressure
- 관련 문서
상세 내용
본문
OpenClaw tracks tokens, not characters. Tokens are model-specific, but most OpenAI-style models average ~4 characters per token for English text.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
How the system prompt is built
OpenClaw assembles its own system prompt on every run. It includes:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- Tool list + short descriptions
- Skills list (metadata only; instructions load on demand with
read). Native - Self-update instructions
- Workspace + bootstrap files (
AGENTS.md,SOUL.md,TOOLS.md, - Native Codex turns do not paste raw
MEMORY.mdwhen memory tools are - Lowercase root
memory.mdis never injected. It is legacy repair input memory/*.mddaily files are not part of the normal bootstrap prompt;- Post-compaction
AGENTS.mdexcerpts require explicit - Time (UTC + user timezone)
- Reply tags + heartbeat behavior
- Runtime metadata (host/OS/model/thinking)
What counts in the context window
Everything the model receives counts toward the context limit:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- System prompt (all sections above)
- Conversation history (user + assistant messages)
- Tool calls and tool results
- Attachments/transcripts (images, audio, files)
- Compaction summaries and pruning artifacts
- Provider wrappers or safety headers (not visible, but still counted)
- Lower values reduce vision-token usage and payload size.
- Higher values preserve more visual detail for OCR/UI-heavy screenshots.
| Key | Purpose |
|---|---|
memoryGetMaxChars |
Max characters memory_get returns before truncation. |
postCompactionMaxChars |
Max characters retained from AGENTS.md during post-compaction refresh. |
How to see current token usage
last response input/output tokens, and estimated cost when local pricing is configured for the active model.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
/status-> emoji-rich status card with the session model, context usage,/usage off|tokens|full-> appends a per-response usage footer to every/usage reset(aliases:inherit,clear,default) clears the/usage tokensshows turn token/cache details./usage fullshows compact model/context/cost details; estimated cost/usage cost-> local cost summary from OpenClaw session logs.- TUI/Web TUI:
/statusand/usageare supported. - CLI:
openclaw status --usageandopenclaw channels listshow
Cost estimation (when shown)
Costs are estimated from your model pricing config:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
models.providers.<provider>.models[].cost
Cache TTL and pruning impact
Provider prompt caching only applies within the cache TTL window. OpenClaw can optionally run cache-ttl pruning: it prunes the session once the cache TTL has expired, then resets the cache window so subsequent requests re-use the freshly cached context instead of re-caching the full history. This keeps cache write costs lower when a session goes idle past the TTL.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Example: keep 1h cache warm with heartbeat
agents:
defaults:
model:
primary: "anthropic/claude-opus-4"
models:
"anthropic/claude-opus-4":
params:
cacheRetention: "long"
heartbeat:
every: "55m"
Example: mixed traffic with per-agent cache strategy
agents.entries.*.params merges on top of the selected model's params, so you can override only cacheRetention and inherit other model defaults unchanged.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- id: "research"
- id: "alerts"
agents:
defaults:
model:
primary: "anthropic/claude-opus-4"
models:
"anthropic/claude-opus-4":
params:
cacheRetention: "long" # default baseline for most agents
list:
- id: "research"
default: true
heartbeat:
every: "55m" # keep long cache warm for deep sessions
- id: "alerts"
params:
cacheRetention: "none" # avoid cache writes for bursty notifications
Anthropic 1M context
OpenClaw sizes GA-capable Claude 4.x models such as Opus 4.8, Opus 4.7, Opus 4.6, and Sonnet 4.6 with Anthropic's 1M context window. You do not need params.context1m: true for those models.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
agents:
defaults:
models:
"anthropic/claude-opus-4":
alias: opus
Tips for reducing token pressure
See Skills for the exact skill list overhead formula.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- Use
/compactto summarize long sessions. - Trim large tool outputs in your workflows.
- Lower
agents.defaults.imageMaxDimensionPxfor screenshot-heavy sessions. - Keep skill descriptions short (skill list is injected into the prompt).
- Prefer smaller models for verbose, exploratory work.
관련 문서
주요 항목:
- API usage and costs
- Prompt caching
- Usage tracking
실습 체크리스트
- 공식 문서와 로컬 버전을 대조합니다:
https://docs.openclaw.ai/reference/token-use - 관련 CLI는
openclaw --help및 하위 명령--help로 옵션을 확인합니다. - 설정 변경 시
openclaw config/openclaw doctor로 유효성을 검사합니다. - Gateway·채널·플러그인 변경 후에는 필요 시 Gateway를 재시작합니다.
자주 쓰는 명령·설정 예시
models.providers.<provider>.models[].cost
agents:
defaults:
model:
primary: "anthropic/claude-opus-4"
models:
"anthropic/claude-opus-4":
params:
cacheRetention: "long"
heartbeat:
every: "55m"
agents:
defaults:
model:
primary: "anthropic/claude-opus-4"
models:
"anthropic/claude-opus-4":
params:
cacheRetention: "long" # default baseline for most agents
list:
- id: "research"
default: true
heartbeat:
every: "55m" # keep long cache warm for deep sessions
- id: "alerts"
params:
cacheRetention: "none" # avoid cache writes for bursty notifications
agents:
defaults:
models:
"anthropic/claude-opus-4":
alias: opus
관련 링크
- 공식 원문: reference/token-use
- OpenClaw 문서 홈
이 가이드는 공식 문서를 한국어 학습용으로 재구성한 것입니다. 옵션 기본값·플래그 이름은 설치 버전에 따라 달라질 수 있습니다.