What is an API relay for AI agents?
An API relay is middleware between an autonomous agent and someone else's HTTP API. The agent talks to the relay; the relay attaches credentials, enforces scopes, and forwards the call. Without that layer, the usual shortcut is to paste a vendor API key into a prompt or a `.env` file the model can read.
That shortcut fails the moment the key appears in chat logs, commit history, or a support ticket. A relay exists so the agent never holds the long-lived secret, and so you can revoke access without rotating every integration by hand.
Empyre Relay at relay.empyre.dev is one shipped answer in the OAuth-for-agents category. It is not a generic passthrough proxy for arbitrary URLs. The sections below separate the two meanings of "API relay," what breaks without either, and where Relay stops and Vault starts.
Two different things people mean by "API relay"
Searchers often collapse two patterns under one phrase. Keeping them separate prevents buying the wrong product.
**Auth and token relay.** The relay mints or refreshes short-lived bearer tokens after a human or owner approves once. The agent receives scoped access, not the vendor password or root API key. Empyre Relay is in this bucket: hosted OAuth for agents, with mandatory S256 PKCE and one-time codes. Refresh rotation and fail-closed revoke are defaults. The product has been feature-frozen since 2026-07-10, with bug and security fixes only.
**HTTP gateway relay.** A service accepts agent requests and forwards them to Stripe, GitHub, Gmail, or any base URL you configure, often with rate limits and audit logs. That solves routing and observability. It does not, by itself, replace OAuth when the upstream API expects a user-delegated token rather than a static key.
Many failures need both: OAuth so the upstream accepts the call, plus a narrow gateway so the agent cannot hit endpoints you never approved.
What breaks when agents call APIs without a relay
Each item is a mechanism, not a scare story. Any one of them is enough to justify a controlled middle layer:
Secrets in the context window
A key pasted into a prompt can be echoed back, summarized into logs, or stored in vector memory. Revoking it means hunting every copy, not clicking revoke in one dashboard.
No scope boundary
A root API key often grants write, read, and admin in one string. An agent asked to "check email" can still delete mail if the key allows it. Relays attach least-privilege scopes per tool.
No owner on unattended runs
Cron jobs and headless agents run when nobody is watching. OAuth built for humans sitting at a browser breaks unless refresh, rotation, and replay detection are defaults.
Audit gaps
When every call uses the founder's personal token, support cannot tell which agent action fired. A relay can log client id, agent id, and scope without storing the upstream secret.
When founders actually deploy an API relay
You need a relay-shaped layer when an agent must act on a live account the founder already uses. That includes posting as a brand, reading CRM rows, or merging a pull request. The test is not "is there an API?" Every SaaS has an API. The test is whether unattended software should hold the same credential the founder uses in a browser.
You can skip a dedicated relay when the integration is read-only public data. You can also skip it when a human pastes a one-time token for a single session and accepts the leak risk. Production agents on a schedule fail that bar quickly.
Generated companies on Empyre still need upstream OAuth for the founder's tools. Relay solves agent identity for apps you build. It does not replace wiring Gmail, X, or Stripe Connect inside the company builder; those flows live in Empyre's own integration layer.
Auth relay vs HTTP gateway vs secret signing
| Layer | What it holds | Typical failure it fixes |
|---|---|---|
| OAuth / token relay (Empyre Relay) | Refresh families, client ids, scoped bearer tokens | Long-lived passwords in agent config; tokens that never expire; no revoke path |
| HTTP API gateway | Route tables, rate limits, request transforms | Agents calling arbitrary endpoints; no central audit of outbound traffic |
| Signing relay (Empyre Vault) | Private keys with no read path; signatures out only | Servers that must sign payloads but must not exfiltrate the key material |
How Empyre Relay fits, and what it is not
Empyre Relay is **OAuth for AI agents**, not a label for "any API proxy." Hosted consent, agent registration, and token endpoints are served under `/relay/*` on the platform API. The dashboard lives at relay.empyre.dev. The published npm package is `@empyre/relay-sdk` **1.0.0** on registry.npmjs.org, read 2026-09-16.
Relay has been feature-frozen since 2026-07-10. The OAuth contract in the SDK stays stable; only bug and security fixes ship. The scoped `GET /relay/oauth/userinfo` endpoint added 2026-08-06 returns consented profile claims so relying parties stop inventing display handles.
Relay bills separately from Empyre company-builder plans. Dollar tiers on relay.empyre.dev/pricing were not re-copied here on 2026-09-16. If you need checkout figures, read that page the day you buy. An auth request counts token issuance and refresh from registered clients, not every HTTP call your app makes afterward.
For install steps, MCP paste URLs, and the "Relay plugin" search intent, use the companion page on SDK and connectors. The concept lives here; npm install details live there.
Where Empyre the company builder fits
Empyre (empyre.dev) turns a brief into a live company: repository, deploy, inbox, payments path, and eight agents that keep operating after launch. That is a different purchase from Relay. Relay answers "how does this agent prove who it is to my app?" Empyre answers "who runs the business once the app exists?"
The first deploy ceiling is thirty minutes from submit, not fifteen. Agents may ship sooner; the deadline is a ceiling written into launch, not a schedule to fill.
Vault (vault.empyre.dev) and Ledger (ledger.empyre.dev) are sibling products on the same account. Choose Vault when the risk is key exfiltration, Relay when the risk is delegated login, Ledger when the risk is untrusted arithmetic on money rows.
Common questions
Is an API relay the same as a reverse proxy?
A reverse proxy terminates TLS and forwards bytes. An API relay in the agent context usually adds identity: which client, which scopes, which upstream token. You can combine both, but they are not interchangeable words.
Does Empyre Relay forward arbitrary third-party HTTP for me?
No. Relay implements OAuth for agents: clients, consent, codes, refresh, revoke, and introspect. Your app still calls GitHub, Google, or your own API with the short-lived token Relay issued. It is not a universal HTTP proxy catalog.
How is this different from the Relay plugin article?
The plugin article names `@empyre/relay-sdk`, relay.empyre.dev/mcp, and why there is no plugin store. The API-relay pattern is defined here first. Read both if you are integrating; start here if you are deciding whether you need a relay at all.
What npm package implements Empyre Relay?
`@empyre/relay-sdk`, latest **1.0.0** on registry.npmjs.org on 2026-09-16. Scope must be `@empyre`, not a fictional `@empyre/relay` package name.
When do I need Vault instead of Relay?
When the agent must sign a payload or decrypt with a key that must never leave storage. Vault returns signatures, not key bytes. Relay returns OAuth tokens after approval. Leaked keys in prompts are the Vault-shaped failure; leaked passwords in prompts are the Relay-shaped failure.
Are other companies' "Relay" products the same?
Many products use Relay in the name for email, CRM, or generic automation. Verify the domain and docs before integrating. Empyre Relay lives at relay.empyre.dev by EmpyreDev, Inc.
Try Empyre free
Describe a business in plain words and watch eight AI agents build and deploy it. The first build is free — no card required.