SDKs & MCP Forgebench MCP Budgets & agent keys

Budgets & Agent Keys

Manage spend and rate limits, and issue API keys for your registered agents.

Request an agent key in your coding assistant, then review it securely in your browser.

Changing agent budgets

Inspect and update limits in chat:

"Show details for researcher-agent"
"Set researcher-agent's monthly budget to $40"
"Limit researcher-agent to 100 tool calls per hour"

How budget changes work

  1. Decreases and small adjustments: applied in chat after you confirm.
  2. Increases above your role's self-service limit (dollar or token): your assistant returns a confirm_url and reports Budget change requires console confirmation. Open the link, sign in, and approve the change.
  3. Increases above the workspace cap: sent to workspace admins as an approval request. If you see Budget exceeds workspace cap, lower the proposed cap or ask an admin to raise the workspace budget.

Claiming agent API credentials

API keys are never printed in chat (Zero Secrets in Chat).

Step 1: Request a credential

Type:

Give me an API key for researcher-agent

Your assistant returns a single-use claim link:

Here is your secure link to reveal the API key for 'researcher-agent':
https://app.forgebench.ai/confirm/cred_claim_8b39a...

(Link expires in 15 minutes)

Step 2: Reveal the key in your browser

  1. Open the link.
  2. Sign in to Forgebench. Only the agent's owner or a workspace admin can reveal the key; anyone else gets a permission error.
  3. Review the agent's permissions, model allowlist and budget.
  4. Click Reveal Key and copy the secret (sk_agent_...).

If the link expired or you lost a key, ask for a new one: "Give me a new key for researcher-agent". Issuing a new key doesn't revoke earlier ones.


Step 3: Run your agent with the credential

Store the key in your project's .env file, and make sure .env is in .gitignore:

export FORGEBENCH_AGENT_KEY="sk_agent_01h8..."
export FORGEBENCH_GATEWAY_URL="https://api.forgebench.ai/v1"

Use it in your agent code:

import os
from forgebench import Forgebench

client = Forgebench(
  api_key=os.environ["FORGEBENCH_AGENT_KEY"],
  base_url="https://api.forgebench.ai"
)

response = client.chat.completions.create(
  model="gpt-4o",
  messages=[{"role": "user", "content": "hello"}],
)

Your agent moves from sealed to registered, then to active after its first successful call.

Cookie settings

Our Cookie Policy lists every cookie and what it does.