# AgentTools ROI Calculator

> AgentTools ROI Calculator is a paid API for AI agents from agenttools-hub.vercel.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-02).

Calculates return on investment, returning both the absolute profit/loss and the percentage return relative to the initial invested amount.

## Facts

- Endpoint: GET https://agenttools-hub.vercel.app/api/v1/finance/roi-calculator?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agenttools-roi-calculator-0a5bcac9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-Vgbd-ss1Bh-y0V_lHTV4

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agenttools-roi-calculator-0a5bcac9
```

Example prompt: I invested $5,000 in a stock and it's now worth $6,750 — can you calculate my ROI and tell me the percentage gain?

## When to prefer this

Use this endpoint when you need a quick, reliable computation of ROI percentage and profit/loss from just two numbers (initial and final value). Prefer it over building your own formula when working inside an agent pipeline that already handles x402 micropayments, and when you need a clean JSON response without the overhead of a full financial analytics platform.

## Known failure modes

- Missing required 'initial' or 'final' query parameters returns a validation error
- Passing zero as the initial investment will cause a division-by-zero error
- Non-numeric values for initial or final will be rejected
- Payment failure (402) if USDC micropayment is not provided or accepted

## How this service works

Calculate return on investment: profit (or loss) and the percentage return relative to the initial amount invested. Use this when an agent needs to return on investment as a percentage.

## Output

Returns the profit or loss amount (final minus initial) and the ROI as a percentage ((final - initial) / initial * 100), so the agent knows both the absolute gain/loss and the relative return on the investment.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "initial",
      "final"
     ],
     "properties": {
      "final": {
       "type": "number",
       "description": "Final value"
      },
      "initial": {
       "type": "number",
       "description": "Amount invested"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agenttools-roi-calculator-0a5bcac9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agenttools-hub.vercel.app](https://www.zero.xyz/host/agenttools-hub.vercel.app/llms.txt)
