# Reuse one source across agent runs

## Problem

Agent runs share an expensive or fragile origin with your interactive traffic,
and each run can open many requests at once. You want them inside the origin's
concurrency limit, on a source that already exists, without creating a new source
every session or handing agents the upstream credential.

## Fix

1. Confirm a [Capacity](/docs/capacity) budget named for the origin (for example
   **NetSuite**). Set the shared concurrency limit once.
2. Use a source already on that budget. Create a source only if none fits (with its
   own origins and credentials), then attach it to the budget in the dashboard.
3. Mint an **access key** for callers. Use a TTL (`1h`, `24h`, or `7d`) for
   session runs. Keep a longer-lived project key only in repo env when the team
   accepts that risk.
4. Commit a short skill (or `AGENTS.md` snippet) naming the source's endpoint, the env
   var that holds the access key, and a tag convention. Refer to the source by the
   budget's name (**NetSuite**), not as "the capacity budget."
5. Agents call the source's endpoint for day-to-day work and never touch the Control API.
   Orchestrators use the [Control API](/docs/api/control) to find a source and mint
   short-lived keys. AI assistants connect at `https://swarmvia.com/mcp`
   ([Agents](/docs/agents)) and use the [MCP server](/docs/mcp) for the same
   discovery and session keys.

If the project key is missing, stop and tell the human. Do not invent
credentials or provision infrastructure unless they explicitly ask.

## Copy-paste skill (NetSuite example)

Copy the skill below into your project. Substitute your budget name, the source's
endpoint, and env var.

```markdown
# NetSuite via swarmvia

Copy this into a customer repo as a skill, `AGENTS.md` section, or rules
snippet. Substitute the source's endpoint and env var for your team. NetSuite is the
worked example. The same shape works for any origin with a shared concurrency
limit.

For SuiteQL and NetSuite REST, call the team's NetSuite source. Do not hit
NetSuite directly. Do not create a new swarmvia source.

- Base URL: `https://netsuite.swarmvia.cloud`
- Auth: `Authorization: Bearer $NTHBOUNCER_NETSUITE_KEY` (swarmvia access key;
  swarmvia attaches the NetSuite credential upstream. Do not add TBA tokens.)
- Tag runs: `x-swarmvia-tags: agent=<session-or-pr-id>`
- SuiteQL paths stay as on the origin; only the host changes.

If the key is missing, stop and tell the human. Do not invent credentials
or provision infrastructure unless they explicitly ask. Never ask for or
store NetSuite secrets in the repo.
```

## Related

- [Agents](/docs/agents)
- [MCP server](/docs/mcp)
- [Control API](/docs/api/control)
- [Proxy NetSuite under a concurrency limit](/docs/knowledge-base/netsuite-rest)
- [Capacity](/docs/capacity)
- [Access](/docs/sources/access)
