At a glance
- Key: an opaque string, created in the partner portal, shown once, expires 365 days after creation.
- Header:
X-API-Keyon every call except the public endpoints. Agent actions addX-Grant-Token. - Where it lives: your backend only. Never in a browser, a mobile app or a model prompt.
- Limits: 1,500 requests per minute per key, 4,000 per partner, 100 new agents per 24 hours.
Quick setup
1
Create a key
Create a partner API key in the partner portal and store it in your secret manager right away. It’s shown only once.
2
Set two environment variables
Every example in these docs reads them:The SDK uses
.env
https://api.agentsonintents.com unless you pass baseUrl.3
Check the key
GET /v1/whoami answers with the key and the partner account it belongs to.401 invalid_api_key. A key created before the partner portal returns 401 api_key_retired: create a new one in the portal.What the partner API key does
The key gives your backend access to the Agent API. It tells the API which partner is calling, so it can apply your rate limits and quotas and keep your agents separate from every other partner’s.With the key alone, you can
- Create agents for any number of owners, up to your quota
- Prepare owner requests and submit the owner’s signatures
- Read your agents, balances, policies, grants and statuses
- Get swap quotes and limit-order previews (
dry: true) - Read an agent’s limit orders
- Create deposit addresses that fund an agent
- Check your quotas
The key alone can't
- Move an agent’s funds out. A swap, limit order, withdrawal or transfer also needs a grant token the owner signed for.
- Change an agent’s policy or grants. That needs the owner’s signature.
- See or touch agents that belong to another partner
Headers
Send JSON bodies with
Content-Type: application/json. Bodies can be up to 256 KiB.
Grant tokens
Your partner API key says which partner is calling. It isn’t the owner’s permission. To run a swap, limit order, withdrawal, transfer, shield or native request, you also send the token of a grant the owner signed for that agent.- Your backend creates a random token (
ngt_…) and its SHA-256 commitment. - You send only the commitment, as
credential, in agrant_issueintent. Never send the token itself. - The owner signs the grant.
- You send the token as
X-Grant-Tokenon agent actions. With the SDK,api.forGrant(token)does this for you.
Key handling
- Opaque. Treat the key as an opaque string. Don’t check its prefix or format, and don’t parse it.
- Where keys come from. You create, list and revoke keys in the partner portal. The Agent API has no key endpoints. The portal shows a key once, so store it right away.
- Rotation. Create a new key in the portal, switch your backend to it, then revoke the old one in the portal. Agents and grant tokens keep working with the new key. Revoking a key stops any work sent through it that the API hasn’t yet committed to the wallet. Work already committed can’t be recalled.
- Revocation timing. A revoked key stops new dispatches at once and every other request within 30 seconds.
- Expiry. A key expires 365 days after you create it. Create its replacement before then.
- Number of keys. The portal allows up to 10 live keys per partner. Revoking one frees a slot.
- Portal outage. While the portal is down, a key keeps the last answer the portal gave for it, so a revocation made during the outage may not apply until the portal is back. A key the portal never answered for gets
503 key_verification_unavailable: send the same request again later. - Retired keys. Keys created before the partner portal no longer work. They get
401 api_key_retired, which is not retryable. Create a new key in the portal.
Limits and quotas
By default, each key gets 1,500 requests per minute and your partner account 4,000. You can create 100 agents per rolling 24 hours and 100 deposit addresses per agent per rolling 24 hours, hold 10 live keys, and change each agent’s policy once per 10 minutes. Over a limit, the API answers429 with a Retry-After header.
Read your own limits with GET /v1/quotas. See Network & Quotas for every limit and how to retry a 429.
Public endpoints
These endpoints need no key:
See Network & Quotas for what
GET /v1/network reports.
Common errors
See Status & Errors for every error code.