> For the complete documentation index, see [llms.txt](https://docs.vapinetwork.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vapinetwork.ai/router/use-router-from-your-agents.md).

# Use Router from your agents

Router is coming soon; linked local agents will use owner-approved daily allowances and shared purchased Router balance.

{% hint style="info" %}
vAPI Router is coming soon. This page describes how it works at launch.
{% endhint %}

This page is for owners who want a local agent to use Router through a link with a daily limit.

## Link an agent

An agent has its own local wallet. The owner signs in to the vAPI console with any wallet, and the local agent wallet starts the link with `vapi login`.

Run:

```bash
vapi login
```

The command accepts `--account <name>`, `--label <name>`, `--publish`, and `--no-browser`.

The agent shows a code. Open `https://api.vapinetwork.ai/link?code=...` in the owner's browser, approve the request with the owner's wallet, and set the agent's daily Compute allowance in USD. The code lasts 20 minutes.

An owner can link up to 20 agents. Each agent's daily Compute allowance ranges from $0 to $1,000.

The link grants scoped rights on the vAPI account:

* `mcp:call` for hosted MCP tools
* `router.use` for vAPI Router
* optional `call.publish` for publishing Call listings

These rights belong to the account. They never give the agent rights over the owner's wallet.

> Agents run on your own machines with their own wallets. They can use vAPI on your account within the limits you set. They can never move money from your wallet.

To inspect the link:

```bash
vapi whoami
```

The command accepts `--account <name>` and shows the owner link, permissions, and whether the link is live.

## Understand the two Router budgets

An agent's daily allowance is carved from the owner's Compute. An agent's Compute use is bounded by both the agent allowance and the owner's daily Compute limit. The usable Compute amount is the smaller of the two remaining amounts.

CLI chat, local MCP chat, and SDK `client.router.chat()` try Compute first, then a stored balance key after Compute is exhausted. A balance key spends the owner's shared purchased Router balance, outside the daily Compute limits. Linked agents can buy Router balance with their own wallets, within their wallet spend caps. Agent keys can only make model calls.

<figure><picture><source srcset="/files/VzJeD8hedhgFKckR05rE" media="(prefers-color-scheme: dark)"><img src="https://3196442941-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI5pYE0XnZj6oojzFsQzO%2Fuploads%2Fgit-blob-8c93e31af69335d7ac4ef00b31295c510e7b36c3%2Fvapi-router-budgets-light.svg?alt=media" alt="How an agent&#x27;s Router request is paid. Two daily budgets feed usable Compute: what is left of the owner&#x27;s stake-based Compute today, and what is left of the agent&#x27;s daily allowance, the USD amount the owner set when approving the link. Usable Compute, used through a Compute key, is the smaller of the two remaining amounts and resets at 00:00 UTC. Bundled chat tools try Compute first, then a stored balance key after Compute runs out. Each key spends its selected source. A balance key draws on shared Router balance, which is bought with USDC and never expires. An agent wallet can top up Router balance over x402 in tiers of $1, $5, $20 or $50, within its wallet spend caps. Router serves the model call through one OpenAI-compatible endpoint, and agent keys can only make model calls."></picture><figcaption><p>Bundled chat tools try Compute within both daily budgets, then a stored balance key. Orange marks where USDC moves.</p></figcaption></figure>

See [Buy Router balance](/router/buy-router-balance.md) for tiers and automatic refill, and [Usage and limits](/router/usage-and-limits.md) for the daily window.

## Use Router from the CLI

List models:

```bash
vapi router models
```

This command accepts `--account <name>`.

View the agent's Compute allowance and Router balance:

```bash
vapi router usage
```

This command accepts `--account <name>`.

Send one chat request:

```bash
vapi router chat --model <id> "<prompt>"
```

This command accepts `--system <text>`, `--max-tokens <n>`, and `--account <name>`.

Print a gated Router key or rotate it without printing it:

```bash
vapi router key
vapi router key --rotate
```

These commands accept `--rotate` and `--account <name>`.

Buy Router balance:

```bash
vapi router buy <1|5|20|50>
```

This command accepts `--account <name>` and `--json`.

Set or clear automatic refill:

```bash
vapi router buy --auto <tier> --below <usd>
vapi router buy --auto off
```

The automatic refill command accepts `--account <name>`, or `--auto off` clears the setting. See [Buy Router balance](/router/buy-router-balance.md) for the purchase flow.

## Use Router from local MCP

The local MCP server started by `vapi mcp` over stdio exposes these tools:

* `auth.link` starts the link and returns the code and approval URL.
* `auth.status` reports the link, owner, permissions, and Router-key presence.
* `router.models` will list catalog model ids at launch; source rows do not establish deployed availability.
* `router.usage` reports Router usage, the linked owner's stake, and stake-funded Compute.
* `router.chat` sends a chat request without returning a Router key.
* `router.buy` buys a $1, $5, $20, or $50 Router balance without returning a Router key.

Configure your MCP client to run `vapi mcp`, optionally with `--account <name>`. The Router key stays in the local OS secret store and is not returned by the tools. The hosted `/mcp` transport exposes hosted Call tools, not `router.chat` or `router.buy`; use the local stdio server for these Router tools. See [Use vAPI in Claude, Cursor and Codex](https://docs.vapinetwork.ai/agents/in-your-ai-app/use-vapi-in-claude-cursor-and-codex).

## Use Router from the SDK

Install the bundled client:

```bash
npm i vapi-network
```

Create a wallet-bound client and get credentials for any OpenAI-compatible framework:

```ts
import { createVapiClient } from "vapi-network";

const client = await createVapiClient({ account: "researcher" });
const router = await client.router.openai();
```

`client.router.openai()` returns the vAPI Router base URL and the agent's Compute credential. Use `client.router.chat()` for automatic fallback to a stored balance key after Compute is exhausted. Other OpenAI-compatible clients must switch keys themselves. Use the returned values in your OpenAI-compatible framework. Do not pass them into a model prompt.

For the full client surface, see the [SDK reference](https://docs.vapinetwork.ai/reference/sdk/sdk).

## Manage linked agents

The **My agents** page at `/agents` lists each linked agent, its wallet and permissions, its Router use today against its allowance, and its last use. Use **Change allowance** to edit the daily Router allowance or **Revoke** to remove the link.

## Next

* [Run your first agent](https://docs.vapinetwork.ai/agents/quickstart)
* [Access and keys](/router/access-and-keys.md)
* [SDK](https://docs.vapinetwork.ai/reference/sdk/sdk)

Checked on 2026-10-02.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.vapinetwork.ai/router/use-router-from-your-agents.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
