Start with your own usage
Open Usage in Console and group requests by model or API key. Compare similar tasks rather than relying on a generic hourly estimate. Record at least:- input, output, and cached tokens
- cost per completed task
- failed or repeated requests
- the model and API key used
Match the model to the work
The most expensive model does not need to handle every step.
Use the Models page for current prices and capabilities. Test candidate models on the same representative task before changing a production tool.
Keep context intentional
- Include the files and logs needed for the current task, not the whole repository by default.
- Start a new conversation when old history no longer helps.
- Let the agent search for code instead of pasting large directories into every prompt.
- Keep reusable instructions short and remove duplicated rules.
Limit unnecessary output
Setmax_tokens when the client supports it and the task has a predictable answer length:
Use caching only when it is documented
Some models charge less for cached input. Check the model’s price details before counting on a cache discount, and confirm cached-token usage in the response or Usage. Cache behavior and prices differ by model.Separate projects with API keys
Use a different API key for each project or coding tool when you need separate limits and usage history. A key-level limit can stop one tool from consuming the full account balance.Compare changes with real tasks
- Choose a small set of tasks that represents your normal work.
- Run the same tasks with each candidate model and the same context.
- Compare completion quality, retries, total tokens, and final cost in Usage.
Tool setup
Claude Code
Connect Claude Code with the Anthropic-compatible API.
Codex CLI
Configure the TokenLab base URL and API key.
Cursor
Review the supported BYOK boundary before setup.
OpenCode
Add TokenLab as a custom provider.