Let Claude Code, Cursor, and Codex hit real APIs without your master keys.
Give each AI tool, developer, or workflow its own scoped, revocable RelayKey. Production credentials for OpenAI, Anthropic, Stripe, and your internal APIs never leave the dashboard. Every call logged.
Bulk-import a .env file, replace real keys with RelayKeys
POST any .env contents to /api/v1/import. RelayKey detects the vendor for each key, creates a protected integration, issues a scoped RelayKey, and returns the snippets you need to apply.
curl -X POST https://app.relaykey.ai/api/v1/import \
-H "Authorization: Bearer rk_mgmt_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"env": "OPENAI_API_KEY=sk-real\nANTHROPIC_API_KEY=sk-ant-real\nRESEND_API_KEY=re_real",
"default_ttl_seconds": 2592000
}'Each entry in the response includes a proxy_token, a proxy_base_url, and a snippets object with env, node, and python changes ready to paste in.
Four steps, every time
- 01
Find the keys
Grep .env files and source for real vendor API keys. Any key an app or agent can leak is a candidate.
bashgrep -RhoE '^[A-Z_]+_(API_KEY|TOKEN|SECRET)=.+' \ .env .env.local .env.production 2>/dev/null
- 02
POST to /api/v1/import
Send the keys as a .env paste. Get back proxy URLs and per-SDK snippets.
curlcurl -X POST https://app.relaykey.ai/api/v1/import \ -H "Authorization: Bearer rk_mgmt_xxxxxxxx" \ -H "Content-Type: application/json" \ --data-binary @- < .env
- 03
Apply the SDK snippets
For each imported key, replace the real key in .env with the RelayKey, add the *_BASE_URL var, and pass baseURL to the SDK constructor. The pattern is the same for every SDK.
.env diff- OPENAI_API_KEY=sk-real-master-key + OPENAI_API_KEY=rk_proxy_xxxxxxxx + OPENAI_BASE_URL=https://proxy.relaykey.ai/conn_xxx
- 04
Verify with a single curl
Hit a known-safe upstream path through the proxy. Confirm the request appears in the audit log.
curlcurl -i https://proxy.relaykey.ai/conn_xxx/v1/models \ -H "Authorization: Bearer rk_proxy_..."
The exact one-line change, per SDK
new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
baseURL: process.env.OPENAI_BASE_URL,
});new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY,
});new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY,
baseURL: process.env.ANTHROPIC_BASE_URL,
});new ElevenLabsClient({
apiKey: process.env.ELEVENLABS_API_KEY,
});new ElevenLabsClient({
apiKey: process.env.ELEVENLABS_API_KEY,
environment: process.env.ELEVENLABS_BASE_URL,
});new Resend(process.env.RESEND_API_KEY);
new Resend(process.env.RESEND_API_KEY, {
baseUrl: process.env.RESEND_BASE_URL,
});curl https://api.cloudflare.com/client/v4/zones \ -H "Authorization: Bearer $CF_TOKEN"
curl https://proxy.relaykey.ai/conn_xxx/client/v4/zones \ -H "Authorization: Bearer rk_proxy_..."
stripe.api_key = os.environ["STRIPE_SECRET_KEY"]
stripe.api_key = os.environ["STRIPE_SECRET_KEY"] stripe.api_base = os.environ["STRIPE_BASE_URL"]
Files an agent should read
- /llms.txtShort-form index. Start here.
- /llms-full.txtSelf-contained migration manual. Vendor catalog included.
- /api/openapi.yamlOpenAPI 3.1 spec for the Management API.
- AGENTS.mdRepo-root agent file. Run/build/test commands.
Ready to give your AI tools scoped access?
Get a management API token and post a .env. The response gives each tool its own scoped RelayKey and the code changes needed to stop using real production keys.
Get a management API token