Three levers cut the AI costs of your agents and apps: Code Mode, context management and the Zero Token Architecture. Code Mode and Zero Token also work for Claude Code, Codex and your own agent.
Task: monthly report from CRM, ERP and emailExample, tokens per run
Classic agentFull cost on every run48,000tokens
Code ModeA fraction per run5,800tokens
Zero Token Architecture0 tokens per run0tokensruns without a model
Same work, same result
Code Mode: data flows in code, not through the model
A classic agent sends every intermediate result back to the model and pays for it in tokens every time. In Code Mode the model writes code once that calls the systems in sequence. Only the result goes back to the model.
Also for external agents
Classic agentModelERPModelCRMModelEmailModelevery intermediate result costs tokens
Code ModeModelCodeERPCRMEmailModelonly the result costs tokens
Context management: carry only what matters
Every agent step pays for the entire context. ZiyaOS supports several strategies to keep it small, depending on the agent and the task.
Compaction with limitsWhen the context reaches a limit, it is summarized.
Smart compactionThe cache only lasts a certain time. Shortly before it expires, the context is compacted if it lies within a set range. The next step starts small.
Context foldingFinished sub-steps are folded down to their result. The context stays small without summarizing the whole history.
Zero Token Architecture: build once, then run without tokens
The AI programs the app once. After that it runs as finished code, without a model and without ongoing token costs, no matter how often it runs.
Also for external agents
Classic agent· Full cost on every runEvery step and every intermediate result passes through the model.
Code Mode· A fraction per runThe model writes code once per task. Data flows through the code, not through the model.
Zero Token Architecture· 0 tokens per runThe app is built and runs without a model. Tokens are only spent while building.
Bring your own agent. And save tokens.
Claude Code, Codex, Cursor, Gemini CLI, pi or your own agent: through the AI agent gateway, your agent uses Code Mode too. And when it builds an app, that app then runs without tokens.
Code ModeData flows in code, not through the model.
Zero Token ArchitectureApps it builds then run without tokens.
Every request goes to the right model.
ZiyaOS picks the model per request by task, security level and cost. Simple work goes to small, cheap models, confidential work to the local model, only hard work to the large ones.
Virtual model
Small model
Medium model
Large model
Local model
Frequently asked questions
How do I keep token costs under control?
You keep token costs under control with hard budgets: for the whole organization, for departments and for individual people. ZiyaOS also cuts consumption: with Code Mode, the agent writes one script instead of many individual calls. A finished app then runs with no token costs at all.
When ZiyaOS pays off depends on the use case. With structured data such as financial data, large spreadsheets or database queries, token costs drop by up to 99 %. On top of that comes the time your employees no longer spend on routine work.
How does ZiyaOS deal with hallucinations?
ZiyaOS counters hallucinations with tools: agents don’t guess, they query data directly from your systems instead of making it up. With Code Mode, a script does the math, not the model. Where it matters, a person approves the result.