Code Mode: let AI agents operate your infrastructure securely through code

Instead of sending every tool call through the model, the agent writes code once that does the work. That saves tokens and calculates more reliably.

Get started from €500 / month

GDPR ready
EU AI Act ready
Hosted in the EU
Classic agentModelERPModelCRMModelEmailModelevery intermediate result costs tokensCode ModeCodeModelERPCRMEmailModelonly the result costs tokens

How it works

  1. 1

    Task

    The agent gets a task that needs a lot of data, such as an analysis across thousands of records.

  2. 2

    Script

    Instead of planning call after call, the model writes a short script that calls the endpoints, filters and calculates.

  3. 3

    Sandbox

    The script runs in isolation with the agent's permissions. Every call in it goes through the guard and is logged.

  4. 4

    Result

    Only the result goes back to the model. The intermediate data costs no tokens.

Code Mode in action

In these solutions Code Mode saves tokens and cost.

AI sandbox

Scripts that agents write run in isolation and reach only the functions you release.

Main focusView solution

Reduce token costs

One script instead of many single calls: the agent only gets the result.

Main focusView solution
Live demo

Save tokens on every agent task with ZiyaOS.

In 30 minutes we show you live what that could look like for you.

In detail

  • Calculation in code

    Sums and comparisons are calculated by the code, not the model. The result is correct.

  • Less data leaves

    Only the result goes to your AI provider, not the raw data.

  • Same rules

    The script has the agent's permissions, no more. The guard checks every call.

  • External agents too

    Claude Code, Codex, Cursor and your own agents work through the gateway with the same rules, the same firewall and Code Mode.

  • Context management

    Several strategies keep the context small: summarize, compact in time, fold finished steps.

  • Zero Token Architecture

    If the same task runs again and again, the AI programs an app once. After that it runs as finished code without a model, however often.

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.

AI cost control with ZiyaOS
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.

When does ZiyaOS pay off?

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.

Reduce token costs with ZiyaOS
Your data is protected

Security & trust

Hosted exclusively in Germany. Your own AI. Encrypted, with DPA and TOMs.

Go to the Trust Center
GDPR ready
EU AI Act ready
Hosted in the EU

Code Mode saves tokens here too

Here Code Mode is not the core, but part of the solution.

More features that cut costs

These features interlock.

Get started from €500 / month

Exclusive partner program

Become a ZiyaOS partner

Offer these and more solutions to your customers.

Talk to us

Portrait of Ilirjan Bytyqi, Operations Lead at Ziya GmbH
Your contactIlirjan Bytyqi, M.Sc.Operations Lead at Ziya GmbH

Talk to us

Portrait of Ilirjan Bytyqi, Operations Lead at Ziya GmbH
Your contactIlirjan Bytyqi, M.Sc.Operations Lead at Ziya GmbH

Talk to us

Portrait of Ilirjan Bytyqi, Operations Lead at Ziya GmbH
Your contactIlirjan Bytyqi, M.Sc.Operations Lead at Ziya GmbH

To improve and optimize this website, Ziya uses optional cookies and similar analytics and tracking technologies. This requires your consent, which you can provide by clicking 'Accept All'. If you click 'Decline', Ziya will continue to use only technically necessary cookies.

Independently of this, Ziya measures the reach of these pages on its own servers, without cookies and without recognising you; you can object to that measurement under the individual settings. More information about the cookies and tracking can be found in the privacy policy. You can change your decision at any time via the 'Manage cookies' link in the website footer.For