Create keys with exact access and expiry, and send them as a Bearer token.
Use an API key for scripts and servers, for apps that can't do OAuth, or when you want to set the exact name, access and expiry yourself.
Create a key
- Open Agents in the Drefly Ads portal and click Connect agent.
- Choose Create an API key and pick the app you will use it in.
- Set the name, what the agent can do and when the key expires, then click Create key and connect.
| Setting | Options |
|---|---|
| Key name | Up to 60 characters, so you can tell keys apart |
| What the agent can do | read, or read and write |
| Key expires after | 7, 30 or 90 days |
Keys start with dra_. Drefly keeps only a hash, so copy the key before you close the window.
First hour is read only
A new key can read right away and can write after 60 minutes. This gives you time to revoke a key you didn't create. One click connections don't have this wait, because you approve them while signed in.
Use a key
Send the key in the Authorization header.
claude mcp add --transport http drefly-ads https://ads.drefly.pro/api/ads/mcp \ --header "Authorization: Bearer dra_your_key"
{
"mcpServers": {
"drefly-ads": {
"url": "https://ads.drefly.pro/api/ads/mcp",
"headers": { "Authorization": "Bearer dra_your_key" }
}
}
}curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer dra_your_key" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' Connector URL
For apps that can't send headers, the setup screen also shows a connector URL with the key in its path: https://ads.drefly.pro/api/ads/mcp/[key]. Use the header whenever you can.
Revoke a key
Click Revoke next to the key under Connected agents. The agent loses access at once. Keys also stop working when they expire, after repeated limit breaks, or if the Drefly team blocks agents for the account.
Next steps
Thanks for the feedback. Tell us what was missing