# How to give an AI agent access to many APIs

Three ways to connect an agent to many APIs, what each costs you in keys, bills and code, and how to do it with one key.

The simplest way to give an AI agent many APIs is one key that reaches every provider through one interface. The other ways are wiring each API in by hand, or adding one MCP server per provider. Both work, but every provider adds an account, a key, a bill and its own way of failing.

## Three ways to do it

Ways to connect an agent to many APIs

| Approach | What you manage | Good when |
|---|---|---|
| Wire each API yourself | An account, key, plan and client code per provider | You need one or two APIs and full control |
| One MCP server per provider | An account and key per provider, and a server entry for each | Your agent runs in an MCP client and uses few providers |
| One gateway key | One key, one balance, one bill | Your agent needs many providers, or you want to switch without code changes |

## What breaks as you add providers

- **Keys.** Every key is a secret to store, rotate and keep out of prompts and logs.
- **Bills.** Each provider has its own plan, minimum and invoice.
- **Failures.** Providers fail in different ways: timeouts, empty answers, rate limits. Most still charge for them.
- **Choice.** Your agent can't tell which provider is best for a given job.

## With Arettic

Arettic gives your agent one key for every provider in its catalogue, over REST or [MCP](/mcp).

### 1. Find an endpoint (no key needed)

**curl**

```bash
curl "https://api.arettic.com/v1/endpoints?q=google%20maps"
```

### 2. Call it with the provider's own parameters

**curl**

```bash
curl https://api.arettic.com/v1/call \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{"endpoint": "serper/google-maps-search", "body": {"q": "coffee in Bangalore"}}'
```

A call the provider fails or times out costs nothing. For jobs where a wrong answer costs you, like finding a verified email, let your agent name the job instead. See [how to let an agent choose its provider](/guides/let-agent-choose-api-provider).

## Keep the agent safe

One key also means one place for limits. Every Arettic agent key has a monthly budget and an approval threshold, enforced by the API. See [spending limits](/limits).

## Questions

### Do I need a separate API key for each provider?

Not with a gateway. On Arettic, one agent key covers every provider in the catalogue.

### Should I use MCP or REST?

Use MCP when your agent runs in an MCP client like Claude Code or Cursor. Use REST from your own code. Both reach the same tools.

### What happens when a provider is down?

On Arettic, a call the provider fails costs nothing, and guaranteed jobs can fall back to the next-ranked tool.

Updated 2026-10-23. This page as HTML: https://arettic.com/guides/give-ai-agent-access-to-apis · Markdown: https://arettic.com/guides/give-ai-agent-access-to-apis.md · JSON: https://arettic.com/guides/give-ai-agent-access-to-apis.json
