Call an outside API
-
Ask for the feature in plain words, and name the service:
- The Polymet Agent writes a function that calls the service, and works out which keys it needs.
-
A form titled Requesting backend secrets appears in the chat, with one field per key, such as
RESEND_API_KEY. - Paste each key from the service’s dashboard and click Deploy Secrets. Click Skip to leave them out for now.
- You see Deployed backend secrets. The agent then asks to put the function live: click Deploy.
Add a secret yourself
- Open the Backend view and click Secrets.
- Under Add New Secret, type a Name and a Value. Click Add Secret to add another row.
- Click Create Secrets.
Naming and rules
- Use capital letters and underscores, starting with the service’s name:
STRIPE_SECRET_KEY,RESEND_API_KEY. - Do not start a name with
SUPABASE_orSB_. Your backend already uses those for its own keys. - Secrets are for functions on the server. Never paste a secret key into a prompt asking to use it in a page, because page code runs in the visitor’s browser.
- On a branch the agent does not set secrets, because every branch shares the same backend. Switch to the default branch and ask there. See Manage your data.
Related
- Manage your data — the Backend view and what the agent asks before it changes things
- Add a backend — enable the backend for a project
- Agent connectors — tools the agent itself can call while it works, which is different from APIs your app calls