Save on Gatelum spend
Cut spend without losing quality: cap output, trim context, batch, measure usage and watch the balance.
SKILL.md content
---
name: gatelum-cost-saving
description: Reduce Gatelum spend without breaking quality - cap output, trim context, batch work, measure usage, and watch the balance before it runs out.
license: CC-BY-4.0
---
# Reducing Gatelum spend
Use this skill when a task may run long, repeat many calls, or needs to stay inside a
budget.
## Before the first call
- Check the balance and the current spend: `GET /v1/workspace`.
- Decide the budget in tokens or dollars and stop when it is reached.
- Choose the cheapest model that passes a small probe; see the model-choice skill.
## During the work
- Send only the context the model needs. Remove boilerplate, old turns and duplicated
files before they reach the prompt.
- Set an explicit output cap: `max_tokens` on the request. The default may be larger
than the answer needs.
- Batch independent items into one request when the model supports it instead of paying
for the same instructions many times.
- Reuse results. Cache deterministic answers locally and do not re-ask the same question.
- Retry only transient refusals. A retry of `bad_request` or `balance_depleted` costs
time and changes nothing.
## Measure
Every response carries `usage` (input, output and total tokens). Sum it per task. The
per-request feed is `GET /v1/workspace/activity`; the per-model and per-day totals are
in `GET /v1/workspace?window=7d`.
Report the measured token spend and the model id at the end. If the balance reaches
zero, stop and report `balance_depleted` instead of retrying.
Install this skill
Claude Code
bash
mkdir -p ~/.claude/skills && curl -fsSL "https://gatelum.com/skills/gatelum/gatelum-cost-saving.tar.gz" | tar -xz -C ~/.claude/skillsPowerShell
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.claude\skills" | Out-Null; $tmp = Join-Path $env:TEMP "gatelum-cost-saving.tar.gz"; curl.exe -fsSL "https://gatelum.com/skills/gatelum/gatelum-cost-saving.tar.gz" -o $tmp; tar.exe -xzf $tmp -C "$env:USERPROFILE\.claude\skills"; Remove-Item -Force $tmpCodex & Cursor
bash
mkdir -p ~/.agents/skills && curl -fsSL "https://gatelum.com/skills/gatelum/gatelum-cost-saving.tar.gz" | tar -xz -C ~/.agents/skillsPowerShell
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.agents\skills" | Out-Null; $tmp = Join-Path $env:TEMP "gatelum-cost-saving.tar.gz"; curl.exe -fsSL "https://gatelum.com/skills/gatelum/gatelum-cost-saving.tar.gz" -o $tmp; tar.exe -xzf $tmp -C "$env:USERPROFILE\.agents\skills"; Remove-Item -Force $tmp