What the agent does
This is for a fractional CFO firm that runs finance for venture-backed startups, most of which pay suppliers through Ramp cards and Ramp bill pay. Every month the partner on each account adds a supplier page to the board pack: who the company pays most, how much of its spend goes to a long tail of small vendors, where two teams buy the same thing from different suppliers, and which vendors are new. Building it means exporting card transactions and bills, merging vendor names by hand and pivoting twelve months of rows. The firm gives each client an agent that does that analysis in the client's own Ramp and returns one page and one spreadsheet.
The firm connects a Ramp account of its own and saves the agent once as a template with POST /o/{org}/agents, naming ramp in connections, with instructions that allow reads only. When a client signs, the firm's onboarding calls POST /o/{org}/agents {"template": "<template id>", "name": "spend-<client id>"}, then POST /o/{org}/agents/{agent}/connections {"type": "mcp", "name": "ramp"}, and shows the authorize_url to the client's controller inside the firm's portal. Ramp's docs say that on sign-in the person chooses Full access or Read-only, that each connection acts as the signed-in user with that user's Ramp permissions, and that connections expire after 30 days. The controller picks Read-only, and the firm registers no Ramp application.
A run follows the rules of Ramp's own spend-analysis skill, which Ramp publishes for its MCP server and CLI. Card transactions and bills are separate resources with no unified spend endpoint, so the agent reads both. For totals and group-bys it loads Ramp's reporting workflow with ramp_reporting_get_skill and runs ramp_reporting_query; every Ramp tool takes a required rationale, and the instructions have it write why it makes each call. Ramp's skill warns that a bill's amount is the full invoice and not what was paid in the period, so paid card spend and matched bills stay in separate columns, and bills whose payment_status is OPEN are listed as commitments rather than spend. Negative transaction amounts are refunds and are netted under their vendor and called out.
Ramp does not normalize vendor names, so the agent groups variants such as a supplier written with and without its legal suffix, and lists every merge it made. From the trailing twelve months it writes the analysis the partner asked for in the prompt: the top vendors and their share of spend, the tail (vendors under a threshold, their count and their combined share), categories bought from three or more vendors, vendors paid both by card and by bill, vendors first paid this month, and vendors whose monthly spend rose past a threshold. It approves, pays, edits and creates nothing in Ramp.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "<agent id>",
"input": "Supplier spend analysis for October 2026, trailing 12 months (2025-11-01 to 2026-11-01, UTC). Read only. Load the reporting workflow with ramp_reporting_get_skill before any reporting query, and give every call a rationale. Read card transactions and bills separately and follow every next_page_cursor. Net refunds (negative amounts) under their vendor and list them. Never sum bill amount as paid spend: keep card spend and matched bills in separate columns, and list OPEN bills as commitments. Merge vendor name variants and list every merge. Write spend-analysis.md with: top 15 vendors by card spend and their share of the total; tail spend (vendors under $2,000 in the 12 months: count and share); categories with 3 or more vendors, listing them; vendors paid by both card and bill; vendors first paid in October; vendors whose October spend is over 150% of their monthly average. Write vendors.csv with one row per merged vendor: name, variants, card spend, bills matched, open bills, first and last payment date, category. Approve, pay, edit or create nothing in Ramp."
}- Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
- Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions. The run starts in its own cloud sandbox.
- Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.
What comes back
The session returns spend-analysis.md and vendors.csv as artifacts. The firm's webhook handler matches the run.completed event to the client by the execution_id it stored when it started the run, stores both files and puts the analysis into the draft board pack, where the partner edits it before anyone outside the firm sees it.
What the partner checks first is the merge list, since two suppliers with similar names can be different companies, and then the tail and overlap sections, which are where a recommendation to consolidate would come from. The figures come from the client's Ramp as the controller's sign-in sees it: spend paid outside Ramp, such as a wire from the bank, is not in it, and the page says so. A card total and a bill total are never added together unless Ramp returned payment amounts and dates for the bills.
The page draws no conclusion about which supplier to drop. It shows where spend sits; the partner and the client decide what to do with that.
Run it on every month-end close, per client
The firm's scheduler sends one POST /o/{org}/sessions per client on the third working day of each month, with the client's agent id as agent, the month and the client's thresholds in input, and a request_id that is a UUID v5 of the client id and the month, so a retried job never starts a second run. Runs past the key's max_concurrent wait as queued and start as slots free.
Because Ramp's docs say a connection expires after 30 days, the scheduler first reads GET /o/{org}/agents/{agent}/connections and, when the Ramp connection's status is needs_reauth, sends the client's controller a fresh sign-in through the portal instead of starting a run that cannot read Ramp.
The use case this job follows, with its automation and trigger: Run an agent per customer task.
Why run it on Rush?
Each client's Ramp sign-in is stored in Rush's connection under that client's agent, so the firm holds no Ramp tokens, and a run of one client's agent cannot reach another client's books. The session's accounts lists the connection each run used, which answers a client who asks when the firm last read their Ramp.
Each run has its own computer for the twelve months of pages it reads, and a transcript where every Ramp call carries the rationale the agent gave for it. The firm adds up total_cost_usd per client with GET /o/{org}/sessions?agent=<agent id> to see what the analysis costs to produce for each account, and runs every client at month end at once rather than one after another.
Frequently asked questions
Why are card spend and bills in separate columns?
Ramp's spend-analysis skill says a bill's amount is the full invoice and a payment-date search can match one installment of a partly paid bill. Adding it to card spend would overstate what was paid in the period. The agent keeps them apart unless Ramp returns payment amounts and dates for the bill.
Does the client need a Ramp developer account?
No. The controller signs in on Ramp's own page, chooses Read-only, and the firm registers no Ramp application. Ramp's docs add that when someone cannot connect at all, their Ramp role may not include access to AI tools, which the client's Ramp admin can change.
What happens to a client with two Ramp businesses?
Ramp's docs say each business needs its own connection. The firm makes one agent per business, each signed in to the matching one, and the prompt names which business the analysis is for.
Can the agent approve a bill or change a transaction?
The controller chooses Read-only when signing in, and the template's instructions and each prompt forbid every write as well. The transcript shows each Ramp call and its rationale, so a partner can confirm that a run only read.