# A compute budget that refills itself

> An AI agent can fund its own compute on Gatewayz by delegating ADA from its own Cardano wallet to the Gatewayz stake pool and linking that wallet to its account with a signed message. 95% of the rewards its stake earns Gatewayz becomes a discount balance, and each request then costs 1% of list price until the balance is used. The ADA never leaves the agent's wallet.

**In one line:** Give an agent a wallet and an API key, and its stake keeps topping up the discount its own requests draw from.

An AI agent can pay for most of its own inference on Gatewayz by holding ADA, [delegating](/yield/glossary#delegation) it to the Gatewayz [stake pool](/yield/glossary#stake-pool) from its own wallet, and linking that wallet to its Gatewayz account with a [CIP-8](/yield/glossary#cip-8) signed message. Every [epoch](/yield/glossary#epoch), 95% of the rewards its stake earned Gatewayz is added to an [inference discount balance](/yield/glossary#inference-discount-balance), and each request then costs 1% of its [list price](/yield/glossary#list-price) while that balance lasts. The ADA stays in the agent's wallet the whole time.

**Pre-launch.** The program is built and switched off on mainnet. A working demo runs on Cardano's preprod testnet with test ADA, by invitation. Not available to US or Canadian persons. Every participant must confirm they are not a US or Canadian person before linking a wallet.

## Key takeaways

- The budget refills from staking rewards, not from top-ups: each finished epoch adds a share of what the pool actually received, in USD at the time of recording.
- The discount sits on the Gatewayz account, so every request signed with that account's [API key](/yield/glossary#api-key) draws from it, whichever agent makes the call.
- The agent signs its own delegation transaction and its own link message; Gatewayz never holds its keys or its ADA.
- Every API error carries a stable `code` and a `remedy`, so an agent can decide to retry, re-sign or stop without a human reading prose.
- Everything an agent needs is machine-readable: `/yield/llms.txt`, `/yield/offer.json`, `/yield/errors.json`, `/yield/glossary.json`, and a Markdown twin of every page.
- Rewards never influence routing: a request goes to the same model and provider whether it is paid by discount or by credits.

## Why does an AI agent need a budget that refills itself?

Because an unattended agent runs out of money at the worst time: in the middle of a task, with nobody watching. A budget that tops itself up from stake the agent already holds keeps it running longer without a person reloading credits.

An [AI agent](/learn/what-is-an-ai-agent) that calls models in a loop spends continuously. A fixed prepaid balance has two failure modes: it is too small and the agent stops, or it is too large and a bug burns through it. Yield-as-inference adds a third source between those extremes. The agent's principal stays in its wallet, the stake earns rewards every five-day epoch, and Gatewayz turns 95% of the share Gatewayz received into a discount that covers 99% of each request. The agent's normal credits only pay the remaining 1%, so they last far longer.

The amount is not fixed. It depends on how much the agent delegates, how many blocks the pool mints and the ADA price when rewards are recorded. There is no promised rate, and the launch limits apply:

Launch limits: at most $5 of discount per account per day, and at most $50 per day across the whole program. Limits may change.

## How does the discount behave for an unattended agent?

It behaves like a shared fuel tank on the account. Every request made with any API key on that Gatewayz account draws 99% of its list price from the discount balance first, and the remaining 1% from normal credits.

| Question | Answer |
| --- | --- |
| Where does the balance live? | On the Gatewayz account that owns the API key, not in the wallet |
| Which requests use it? | Every `/v1/chat/completions` and `/v1/messages` request signed with that account's key |
| What does the agent pay per request? | 1% of list price from its credits while the balance lasts |
| What happens when the balance runs out? | Requests are billed at full list price from credits until the next epoch's discount arrives |
| Can the agent withdraw or move it? | No. It is non-transferable, usable only for inference on Gatewayz, and cannot be cashed out |
| Does it expire? | No expiry is set today; any change would be announced before it applies |

Because the discount is cheap to spend, an agent can burn through it quickly. Put a ceiling on what the agent may spend per day or per task, the same as you would without the discount; [Spend ceilings for unattended agents](/learn/spend-ceilings-for-unattended-agents) explains how to set one. The per-account daily limit on the discount is a program limit, not a safety control for your agent.

## What does the agent loop look like?

Five steps, and only one of them is a blockchain transaction. The agent reads the offer, delegates with its own wallet, links the wallet with a signed message, spends through the normal inference API, and watches its balance.

1. **Read the offer.** Fetch `https://www.gatewayz.ai/yield/offer.json` and `GET /delegation/status` to confirm the program is on, read the pool id and network, and load the quote formula.
2. **Delegate.** Build, sign and submit an ordinary Cardano delegation transaction from the agent's wallet to the pool id. Gatewayz is not a party to it. The first time a stake address is used it also pays the one-time [stake address deposit](/yield/glossary#stake-address-deposit), currently 2 ADA and refunded when the address is deregistered.
3. **Link.** `POST /auth/wallet/cardano/nonce`, sign the returned message with the stake key (CIP-8), then `POST /auth/wallet/cardano/link` with the signature and key.
4. **Spend.** Call `/v1/chat/completions` or `/v1/messages` as usual. Billing applies the discount automatically.
5. **Watch.** `GET /delegation/rewards` once a day for the balance, positions and history.

The first discount appears roughly two to three weeks after the first delegation, because Cardano pays rewards a few epochs after they are earned. Plan the agent's credits to cover that gap. The calls, with `curl` examples, are in the [quickstart](/yield/agents/quickstart); fields are in the [API reference](/yield/agents/api).

## Who stays in control: the agent or its owner?

The owner does. The agent controls its wallet and signs its own transactions, but the Gatewayz account, its API keys and its credits belong to whoever created them.

That split is deliberate. The agent never needs the owner's wallet, and the owner never needs the agent's keys. If the agent should stop, stop giving it the API key, and keep its normal-credit balance small so a runaway loop has little to spend. If the stake should move, the wallet holder redelegates; Cardano never blocks that. Treat the API key like a password, because anyone holding it can spend the discount; [How Gatewayz keeps you secure](/learn/how-gatewayz-keeps-you-secure) covers key handling, and [Security](/yield/security) covers what Gatewayz can and cannot touch.

## Which files can an agent read?

Every fact on these pages is also published as data, generated from the same source, so an agent never has to scrape HTML.

| File | What it holds |
| --- | --- |
| `/yield/llms.txt` | The offer in under 300 words, plus links and first calls |
| `/yield/offer.json` | Status, assets, limits, risks, FAQ, endpoints, errors and the quote formula |
| `/yield/errors.json` | Every error code with its HTTP status, when it happens and the remedy |
| `/yield/glossary.json` | Definitions of every term used on these pages |
| `<path>.md` | A Markdown twin of every page, for example `/yield/agents.md` |

All paths are on `https://www.gatewayz.ai`. The API itself is at `https://api.gatewayz.ai`, with an OpenAPI description at `https://api.gatewayz.ai/openapi.json`.

## What rules can an agent rely on?

Three rules hold for every call, so an agent can reason about them without special cases.

- **The agent signs its own transactions.** Gatewayz never builds, holds or co-signs a delegation. Linking is a CIP-8 message signature, which proves control of the stake key without a transaction or a fee.
- **Errors are typed.** Every failure carries an HTTP status plus a stable `code` and a `remedy`. The full list, and how an agent should react to each, is on [Errors](/yield/agents/errors). Why this matters for software readers is explained in [Who reads the error?](/learn/who-reads-the-error).
- **Rewards never influence routing.** The discount changes what a request costs, never which model or provider serves it.

## What's planned?

A yield API and an MCP server are planned so an agent can quote and check policy without reading files. None of these exist yet; today, read `offer.json` and apply its `quote.formula` yourself.

| Method | Path | Auth | Status | What it does |
| --- | --- | --- | --- | --- |
| GET | `/v1/yield/offer` | none | planned | This offer as JSON from the API. Today, read https://www.gatewayz.ai/yield/offer.json. |
| POST | `/v1/yield/quote` | none | planned | A server-side quote. Today, apply the formula in offer.json quote. |
| GET | `/v1/yield/policy` | API key | planned | Owner limits for agents: allowed assets, maximum stake, approval threshold. |

MCP server: planned. Tools: `yield_get_offer`, `yield_quote`, `yield_get_policy`, `yield_get_position`, `credits_balance`.

The planned policy endpoint is where an owner would set limits for an agent: allowed assets, maximum stake and an approval threshold. Until it ships, owner control is the API key and your own spend ceiling.

## Frequently asked questions

### Can an AI agent really pay for its own inference?

Partly. An agent with its own Cardano wallet can delegate ADA to the Gatewayz pool and link the wallet to its account through the API, and the resulting discount covers 99% of each request's list price while it lasts. The agent still needs normal credits for the remaining 1% and for any spend beyond the discount and the daily limits.

### Does the agent have to give Gatewayz its keys?

No. The agent signs its delegation transaction and its link message locally. Gatewayz only receives a CIP-8 signature and the public COSE key, which prove control of the stake address without revealing any secret.

### Which requests use the discount?

Every inference request made with an API key that belongs to the linked Gatewayz account, through `/v1/chat/completions` or `/v1/messages`. If several agents share the account, they share the balance, so give each one its own spend ceiling.

### What happens if the agent's wallet redelegates away?

The agent stops accruing new discount for epochs where its stake is no longer in the Gatewayz pool. Discounts already credited stay on the account, and leaving is never blocked.

### Can an agent use a script stake address?

No. Only key-hash stake addresses, which start with `stake1u` on mainnet, can be linked. Script stake addresses, which start with `stake17`, are rejected with `script_stake_address_unsupported`.

### Is there an MCP server?

Not yet. An MCP server with tools such as `yield_get_offer` and `yield_quote` is planned. Today an agent reads `offer.json` and uses the live REST endpoints listed in the API reference.

## Sources

- [CIP-0008: Message Signing](https://cips.cardano.org/cip/CIP-0008), as of 2026-10-27
- [Cardano Docs: Delegation](https://docs.cardano.org/about-cardano/learn/delegation), as of 2026-10-27
- [Cardano.org Glossary: Stake Address Deposit](https://cardano.org/glossary/stake-address-deposit/), as of 2026-10-27
- [Cardano.org: Stake your ada on Cardano](https://cardano.org/stake-pool-delegation/), as of 2026-10-27

## Related

- [Quickstart: link a Cardano stake address with CIP-8](https://www.gatewayz.ai/yield/agents/quickstart)
- [Delegation API reference](https://www.gatewayz.ai/yield/agents/api)
- [Wallet link and delegation error codes](https://www.gatewayz.ai/yield/agents/errors)
- [How yield-as-inference works](https://www.gatewayz.ai/yield/how-it-works)
- [Is delegating ADA to a stake pool safe?](https://www.gatewayz.ai/yield/security)

---

Discounts are a share of staking rewards Gatewayz actually received, can change at any time, and are not a guaranteed return. Not available to US or Canadian persons. Every participant must confirm they are not a US or Canadian person before linking a wallet. Not investment, legal or tax advice. Figures as of 2026-10-27.

Updated 2026-10-27. Canonical page: https://www.gatewayz.ai/yield/agents
