Quickstart
Get an agent to its first decision in under ten minutes.
This guide takes an outside developer from signup to the first recorded decision from POST /v1/authorizations. RobotMoney does not move money in this flow. Your agent asks for a decision, then your own rail decides what to do with that answer.
Values
Use staging while you build.
API base
https://staging-api.robotmoney.com/v1
https://api.robotmoney.com/v1
Auth issuer
https://staging-auth.robotmoney.com
https://auth.brain.fi
Token endpoint
https://staging-auth.robotmoney.com/token
https://auth.brain.fi/token
API resource
https://staging-api.robotmoney.com/
https://api.brain.fi/
The API also exposes the current agent key exchange metadata:
export BRAIN_API=https://staging-api.robotmoney.com/v1
curl -sS "$BRAIN_API/auth/agent-key-exchange"Response:
{
"issuer": "https://staging-auth.robotmoney.com",
"exchange": {
"token_endpoint": "https://staging-auth.robotmoney.com/token",
"resource": "https://staging-api.robotmoney.com/",
"grant_type": "urn:ietf:params:oauth:grant-type:token-exchange",
"subject_token_type": "urn:brain:params:oauth:token-type:agent-api-key",
"scope": "payment_intent:propose",
"key_display": "once"
}
}Always take the resource value from this discovery response. It is the token audience for the API and is not necessarily the same host as the public API base.
Curl
1. Sign Up
Staging returns a verification_token in the response because staging is a sandbox deploy target. Production sends the token by email.
2. Verify Email
3. Log In
Save the returned owner JWT:
4. Register A Counterparty
The owner JWT is the setup credential. The agent key is only for proposing authorization decisions.
Save the returned counterparty id:
5. Create A Tenant Agent
The response includes a one-time api_key_once value and an exchange object. The key is shown once. Store it in your secret manager.
6. Optional: Set Headless Limits
New self-serve tenants get defaults when they create their first tenant agent: USD 100.00 per authorization and USD 500.00 per day for ach_outbound and card.
Use the owner JWT to change the limit:
7. Exchange The Agent Key
The access token expires after five minutes and has no refresh token. Exchange the agent key again when you need a fresh JWT.
8. Ask For A Decision
invoice_id links a RobotMoney Ledger invoice and requires attached invoice evidence; for your own invoice number use reference.
Expected response for a registered counterparty under the default limit:
A registered counterparty above the limit returns needs_review. An unknown counterparty returns blocked with counterparty_not_registered.
9. Review Or Void Later
If a decision returns needs_review, a user or tenant service credential can approve or reject it:
If an approved external authorization was not paid, a user or tenant service credential can void it so it no longer counts against the policy window:
SDK
Install the SDK:
Use fetch for setup routes that are not yet wrapped by SDK helpers, then use agentApiKey mode for authorization calls. In agentApiKey mode, the SDK reads GET /v1/auth/agent-key-exchange, exchanges the key, and refreshes the five-minute JWT before expiry.
Usage Meter
GET /v1/usage/authorizations?window=30d is read-only. It returns recorded decision counts by tenant, agent, decision, and execution, plus the current catalog unit price and meter-only amount_due. It does not enforce billing and does not collect payment.
Last updated
