For AI Agents

The financial model API
for AI agents.

Layerz lets your agent build structured, auditable financial projections and export them to Excel. SaaS, LBO, manufacturing, consulting — any business model, programmatically.

What is Layerz

Financial compute layer for coding agents.

Layerz is the financial compute layer for Claude Code, Cursor, and coding agents. Define model structure via API or CLI, evaluate dependencies in topological order, export audit-ready Excel.

Models are built from typed items — assumptions, formulas, layers, balances — organized in a section-first hierarchy. The compute engine resolves the dependency DAG and evaluates every node in topological order.

Compute on demand: call GET /compute after any structural change — the engine re-resolves all dependencies automatically. No stale values, no broken cross-sheet references.

The export pipeline generates self-contained Excel workbooks with live formulas and editable assumption cells — every number has an auditable path.

Use cases

Any financial model, programmatically.

From SaaS revenue projections to infrastructure capex schedules — build any financial model via REST API or CLI.

📊

SaaS Revenue Model

MRR, churn rate, expansion revenue, unit economics, LTV/CAC, ARR projections.

🚀

Startup Runway

Burn rate, funding rounds, hiring plan, cash runway milestones, break-even.

🏦

LBO Analysis

Debt tranches, leverage ratios, interest schedules, equity returns, IRR.

🏭

Manufacturing P&L

Raw materials, labor costs, production capacity, gross margins, capex.

💼

Consulting Agency

Utilization rates, day rates, headcount planning, project pipeline.

🏗️

Infrastructure Project

Capex schedule, depreciation, operating cash flows, IRR/NPV analysis.

Why agents choose Layerz

Built for programmatic financial modeling.

Deterministic & Auditable

Every formula is transparent. Results are reproducible. Every number has an auditable path — no hidden cells, no magic constants.

Structured, Not Flat

Typed items (assumptions, formulas, layers, balances) with explicit dependencies. No cell-reference guessing across spreadsheet tabs.

Compute on Demand

One API call evaluates the entire model in dependency order. Get all values, or filter to specific items.

Open Excel Output

Export audit-ready .xlsx with live formulas and editable assumption cells. No vendor lock-in — the Excel file is the deliverable.

Integration

Two paths to build models.

REST API

Agent API v1

Direct HTTP access for cloud-based agents. Full CRUD on models and items, batch operations (up to 100 items), on-demand compute, version history, and snapshot sync.

  • Bearer token authentication
  • 120 requests/min rate limit
  • JSON request/response
  • Optimistic concurrency (ETag)
CLI

Layerz CLI

Local development for coding agents (Claude Code, Cursor, Windsurf). Create and edit models as .layerz.json files, compute and export locally, push/pull sync with the server.

$npm install -g layerz
  • Works offline (local compute + export)
  • Git-friendly .layerz.json format
  • Push/pull with conflict detection
  • Semantic diff (local vs remote)
Quick start

Three steps to your first model.

1

Authenticate

Sign up at app.layerz.cc, go to Avatar → Layerz for Agents, and generate a key. Format: lz_<40 hex>. Pass it as Bearer token or set LAYERZ_API_KEY.

2

Create a model

POST /api/v1/models with a name and optional timelines. The model comes pre-loaded with P&L, Cash flow, and Balance sheet sections.

3

Add items & compute

Use batch create to add assumptions and formulas in one call. Then GET /compute to evaluate everything in dependency order.

API overview

Core endpoints.

MethodPath
POST/api/v1/models
GET/api/v1/models/:id
POST/api/v1/models/:id/items
POST/api/v1/models/:id/items/batch
PATCH/api/v1/models/:id/items/:uid
GET/api/v1/models/:id/compute
POST/api/v1/models/:id/items/reorder
GET/api/v1/models/:id/snapshot
PUT/api/v1/models/:id/snapshot
POST/api/v1/models/:id/versions
POST/api/v1/models/:id/duplicate
DELETE/api/v1/models/:id

View the full API reference for all endpoints, request/response examples, and formula functions.

Code examples

Build a SaaS model in 3 calls.

Step 1 — Create the model
# 1. Create a SaaS revenue model
curl -X POST https://app.layerz.cc/api/v1/models \
  -H "Authorization: Bearer lz_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "SaaS Revenue Model 2026",
    "timelines": {
      "yearly": { "start": "2025-01-01", "end": "2030-12-31" }
    }
  }'
Step 2 — Add items (batch)
# 2. Add assumptions and formulas in one batch
curl -X POST https://app.layerz.cc/api/v1/models/{id}/items/batch \
  -H "Authorization: Bearer lz_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      {
        "temp_id": "mrr",
        "role": "assumption",
        "display_name": "Monthly Recurring Revenue",
        "timeline_ref": "yearly",
        "values": [50000, 85000, 140000, 210000, 300000, 400000],
        "parent_layer_uid": "<revenue_section_uid>"
      },
      {
        "temp_id": "churn",
        "role": "assumption",
        "display_name": "Churn Rate",
        "timeline_ref": "constant",
        "value": 0.05,
        "format": "percent"
      },
      {
        "role": "formula",
        "display_name": "Net Revenue",
        "formula": "mrr * (1 - churn)",
        "inputs": ["mrr", "churn"],
        "parent_layer_uid": "<revenue_section_uid>"
      }
    ]
  }'
Step 3 — Compute
# 3. Compute the model
curl https://app.layerz.cc/api/v1/models/{id}/compute \
  -H "Authorization: Bearer lz_your_key"

# Response:
{
  "values": {
    "mrr_uid":  [50000, 85000, 140000, 210000, 300000, 400000],
    "churn_uid": [0.05],
    "net_uid":  [47500, 80750, 133000, 199500, 285000, 380000]
  },
  "periods": { "yearly": ["2025","2026","2027","2028","2029","2030"] },
  "order": ["mrr_uid", "churn_uid", "net_uid"]
}

Or use the CLI

CLI workflow
# Or use the CLI for local development
layerz create "SaaS Revenue Model 2026"

layerz add-item --role assumption --name "MRR" \
  --timeline yearly --values '[50000,85000,140000,210000,300000,400000]'

layerz add-item --role assumption --name "Churn Rate" \
  --timeline constant --value 0.05 --format percent

layerz add-item --role formula --name "Net Revenue" \
  --formula 'mrr * (1 - churn)' --inputs '["mrr","churn"]'

layerz compute --summary
layerz export --output saas-model.xlsx
layerz push  # Sync to server
Authentication

Simple API key auth.

Key format

lz_<40 hex>

Generate at app.layerz.cc → Avatar → Layerz for Agents.

Usage

Pass as Bearer token:

Authorization: Bearer lz_...

Rate limit

120 requests/min per IP address.

Keys are scoped per user — agents only access their own models.

Plug Layerz into your agent workflow.

REST API or CLI — DAG-based compute, structured Excel output, fits any agentic pipeline.