# Connecting Your AI Agent

> Learn how to connect AI agents like Claude, ChatGPT, Cursor, and others to AgentPMT so they can use tools autonomously.

Content type: documentation
Source URL: https://www.agentpmt.com/docs/connecting-your-agent/connecting-your-ai-agent
Markdown URL: https://www.agentpmt.com/docs/connecting-your-agent/connecting-your-ai-agent?format=agent-md
Category: Connecting Your Agent

---

# Connecting Your AI Agent

AgentPMT works with any AI agent that supports tool calling. Here's how to connect the most popular ones.

---

## What You Need

Before connecting an agent, make sure you have:

1. An AgentPMT account
2. At least one budget with tools added
3. A **Connection Key** for that budget (found in your budget settings)

---

## Connection Methods

### MCP Server

### Model Context Protocol (MCP)

MCP is the recommended way to connect AI agents. It gives agents direct access to your budget's tools through a standardized protocol.

1. **Get your connection details**
   Go to your budget settings and copy the **MCP Server URL** and **Connection Key**.

2. **Configure your agent**
   Add AgentPMT as an MCP server in your agent's configuration. The exact steps depend on the agent (see below).

3. **Start using tools**
   Your agent can now discover and call any tool in your budget.

### API Keys

### Direct API Access

For agents that don't support MCP, you can use API keys to call tools directly.

1. **Generate API keys**
   Go to your dashboard and create an **API Key**. Then go to your budget and create a **Budget Key**.

2. **Pass keys in headers**
   Include `X-API-Key` and `X-Budget-Key` headers in every request your agent makes.

3. **Call tool endpoints**
   Use the AgentPMT API to browse and execute tools programmatically.

---

## Agent-Specific Setup

### Claude (Anthropic)

Claude supports MCP natively. Add AgentPMT as an MCP server in your Claude configuration:

1. Open Claude's MCP settings
2. Add a new server with your AgentPMT MCP URL
3. Provide your Connection Key when prompted
4. Claude will automatically discover available tools

### Cursor

Cursor supports MCP servers in its AI settings:

1. Open Cursor Settings > AI > MCP Servers
2. Click "Add MCP Server"
3. Enter your AgentPMT MCP URL and Connection Key
4. Tools appear in Cursor's agent tool list

### ChatGPT / Custom GPTs

ChatGPT uses the API key method:

1. Create a Custom GPT or use the API
2. Add AgentPMT tool definitions as actions
3. Configure authentication with your API Key and Budget Key
4. The GPT can now call AgentPMT tools

### Other Agents

Any agent that supports HTTP tool calling can connect via the API:

1. Generate your API Key and Budget Key
2. Use the AgentPMT REST API to list and execute tools
3. Pass results back to your agent's context

See the [Developer Documentation](/docs/getting-started/connecting-your-ai-agent) for full API reference.

---

## Testing the Connection

After connecting, verify everything works:

1. Ask your agent to list available tools -- it should return tools from your budget
2. Try a simple tool call (like a free or low-cost tool)
3. Check your **Agent Activity** tab to confirm the call was logged

> TIP: Start with a test budget
>
> Create a separate budget with a small spending cap for testing. This lets you experiment without risking your main budget.

---

## Troubleshooting

| Issue | Solution |
|-------|----------|
| Agent can't find tools | Make sure tools are added to the budget and the Connection Key is correct |
| Authentication errors | Verify your API Key and Budget Key are active and not expired |
| Tool calls failing | Check that required credentials are bound in your budget settings |
| Agent not responding | Confirm your agent supports tool calling or MCP |

---

## Next Steps

- [Watching Agent Activity](/docs/monitoring/watching-agent-activity) - Monitor your agent's tool calls in real time
  - [Setting Spending Caps](/docs/payments-and-billing/setting-spending-caps) - Control how much your agent can spend