# Ailabra Agent Profit Ledger - Analyze

> Ailabra Agent Profit Ledger - Analyze is a paid API for AI agents from x402.ailabra.org, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-15).

Analyzes a batch of economic events (revenue, expenses, fees, transfers, etc.) to produce deterministic profit and cash-flow findings for autonomous agents.

## Facts

- Endpoint: POST https://x402.ailabra.org/api/v1/x402/profit/analyze
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ailabra-agent-profit-ledger-analyze-48d49de8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vqsFPFBpkcQTcNpMdZ_xV

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 ailabra-agent-profit-ledger-analyze-48d49de8 -d '<json body>'
```

Example prompt: Analyze these economic events for my agent venture 'venture-42' and tell me whether it's profitable: a $120 revenue inflow from 'stripe' (receipt_supplied) on 2025-06-01, a $30 fee outflow from 'openai' (system_observed) on 2025-06-01, and a $15 expense outflow from 'aws' (system_observed) on 2025-06-01 — all in USD.

## When to prefer this

Choose this endpoint when you need deterministic, structured profit-and-loss computation for autonomous agent economic activity — especially when events originate from x402 payments, onchain sources, or multi-category ledger streams. Prefer it over generic accounting APIs when you need agent-native constructs like agentId, ventureId, x402PaymentId, and verification levels (onchain_verified, system_observed). Best when you need reproducible, versioned calculation outputs suitable for auditing agent financial behavior.

## Known failure modes

- Missing required fields (schemaVersion, externalId, occurredAt, kind, direction, amount, currency, category, source) cause validation errors
- Invalid amount format (non-numeric or negative) rejected by pattern validation
- Unrecognized currency code (must match ^[A-Z][A-Z0-9]{1,11}$) causes schema rejection
- Invalid kind or direction enum values return validation errors
- Empty events array may return empty findings with no actionable output
- Payment failure (insufficient USDC balance for $0.05 per-call fee) blocks the request
- Duplicate externalId + source.name combinations may be flagged in findings

## How this service works

Deterministic profit and cash-flow infrastructure for autonomous agents.

## Output

Returns a JSON object containing an array of profit/cash-flow findings, plus versioning metadata (schemaVersion, serviceVersion, analysisVersion, calculationEngineVersion). Findings capture the deterministic output of classifying and aggregating the submitted economic events into profit-and-loss signals.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "events": {
   "type": "array",
   "items": {
    "$id": "https://x402.ailabra.org/api/v1/schemas/economic-event",
    "type": "object",
    "title": "Ailabra Economic Event v1",
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "required": [
     "schemaVersion",
     "externalId",
     "occurredAt",
     "kind",
     "direction",
     "amount",
     "currency",
     "category",
     "source"
    ],
    "properties": {
     "kind": {
      "enum": [
       "revenue",
       "expense",
       "refund",
       "fee",
       "transfer",
       "capital",
       "withdrawal",
       "asset_purchase",
       "asset_sale",
       "adjustment"
      ],
      "type": "string"
     },
     "amount": {
      "type": "string",
      "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"
     },
     "source": {
      "type": "object",
      "required": [
       "name",
       "type",
       "verification"
      ],
      "properties": {
       "name": {
        "type": "string",
        "maxLength": 120,
        "minLength": 1,
        "description": "Identifies the originating ledger or integration and participates in duplicate detection with externalId."
       },
       "type": {
        "type": "string"
       },
       "reference": {
        "type": "string"
       },
       "verification": {
        "enum": [
         "self_reported",
         "receipt_supplied",
         "receipt_verified",
         "onchain_verified",
         "system_observed"
        ],
        "type": "string"
       }
      },
      "additionalProperties": false
     },
     "agentId": {
      "type": "string"
     },
     "category": {
      "type": "string",
      "maxLength": 120,
      "minLength": 1
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,11}$"
     },
     "metadata": {
      "type": "object"
     },
     "direction": {
      "enum": [
       "inflow",
       "outflow"
      ],
      "type": "string"
     },
     "productId": {
      "type": "string"
     },
     "ventureId": {
      "type": "string"
     },
     "adjustment": {
      "type": "object",
      "required": [
       "reason",
       "profitTreatment"
      ],
      "properties": {
       "reason": {
        "type": "string"
       },
       "profitTreatment": {
        "enum": [
         "revenue",
         "cost",
         "exclude"
        ],
        "type": "string"
       }
      }
     },
     "customerId": {
      "type": "s
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "findings": [],
  "schemaVersion": "2",
  "serviceVersion": "1.0.9",
  "analysisVersion": "2.0.0",
  "calculationEngineVersion": "2.0.0"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ailabra-agent-profit-ledger-analyze-48d49de8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.ailabra.org](https://www.zero.xyz/host/x402.ailabra.org/llms.txt)
