Skip to content

Agent API

A stateless dose-math API for agents: serum simulation, reconstitution math, and published compound data. $0.01 USDC per compute call over x402 - no accounts, no API keys.

Base URL: https://api.doseplot.com

Disclaimer. Mathematical planning aid. Not medical advice. DosePlot is an informational tool, not a healthcare provider, and using it creates no provider-patient relationship. Do not start, stop, or change any protocol without the approval of a licensed healthcare professional.

Intended use. Outputs are for relay to a human decision-maker; not for autonomous administration.

Quickstart

1. Free read - no payment, no key

curl https://api.doseplot.com/v1/compounds

2. Compute, paid per call - $0.01 USDC over x402

curl -X POST https://api.doseplot.com/v1/simulate \
  -H "content-type: application/json" \
  -d '{"compound":"semaglutide","dose_mg":0.25,"injections_per_week":1,"duration_weeks":4}'

Every compute call needs an x402 payment. An unpaid call answers HTTP 402, and the challenge's discovery block carries the exact request schema, an example body and an example answer. A paid request the engine refuses (an unknown compound, an out-of-range dose) answers its own error and is not settled.

3. Paid call - standard x402 client

import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { wrapFetchWithPayment } from "@x402/fetch";

const client = registerExactEvmScheme(new x402Client(), { signer: account });
const payingFetch = wrapFetchWithPayment(fetch, client);

const res = await payingFetch("https://api.doseplot.com/v1/simulate", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    compound: "semaglutide",
    dose_mg: 0.25,
    injections_per_week: 1,
    duration_weeks: 4,
  }),
});
Proven on mainnet. This exact flow was executed against production on 2026-09-01 and settled on Base: REST settlement tx 0x42d526b79ec3680ec888aadf7f9dfdc8041f1160da2d7c7e5e5a21f5486474fa (block 50762709) and MCP settlement tx 0x5b49e4dbb20611784a63d0c84c7f89b58b4a23dcd7862e1614c4b8a846a04399 (block 50762714), $0.01 USDC each, verified independently on-chain.

4. MCP clients

{
  "mcpServers": {
    "doseplot": {
      "type": "streamable-http",
      "url": "https://api.doseplot.com/mcp"
    }
  }
}

Free tools: list_compounds, get_compound. Paid tools: simulate, recon_calc($0.01 USDC each; payment rides the tool call's _meta["x402/payment"]). Paid tools on MCP and REST alike need an x402 payment on every call.

Surface reference

Free

  • GET / - index: endpoints, price, configured chain.
  • GET /openapi.json - OpenAPI 3.1 description of this API.
  • GET /terms - terms of service, plain text.
  • GET /llms.txt - plain-text orientation page for an agent.
  • GET /v1/compounds - list published compounds with class, half-life, routes and reconstitutability.
  • GET /v1/compounds/{id-or-slug} - full published record for one compound, by id, slug or alias. Reconstitutable records carry vialStrengths with a vialStrengthsUnit marker ("mg" or "IU"; omitted when unknown) - read the unit before doing math on the strengths.

Paid

  • POST /v1/simulate - pharmacokinetic serum curve for one compound at one dose and cadence, over a requested horizon.
  • POST /v1/recon/calc - reconstitution math for one vial and one target dose: concentration, fill volume, syringe marks, doses per vial.

Error model

Every non-2xx response is an RFC 9457 problem+json document with a stable machine-readable code (the full enum is in /openapi.json). The one exception is HTTP 402: instead of a problem+json body it carries the x402 payment-requirements document. Errors never echo the values a caller submitted.

Privacy

Accountless: no sign-up, no API key, nothing tied to an identity. Zero request-body persistence - logs are metadata-only (route, status, duration, country) and are kept up to three months, and the rate-limit counters store salted-hash rate counts only, kept for at most 48 hours.

Named residuals, stated plainly:

  • The payer wallet's association with this API is public on-chain.
  • The payment facilitator sees the paying wallet, the endpoint called, and the time of the call.
  • A settled payment whose response is lost in transit cannot be replayed - a retry is a new payment, never a double settlement.

Links