---
title: "Free audit of cost per successful agent task. No payment and no trace persistence."
method: POST
path: "/api/v1/spend-proof"
---

# Free audit of cost per successful agent task. No payment and no trace persistence.

`POST /api/v1/spend-proof`

## Request

- Base URL: `https://alpnai.com`
- URL: `https://alpnai.com/api/v1/spend-proof`
- Auth: HTTP bearer

## Request body

- object: Recorded attempts, not prompts or secrets. Identical rows count as separate attempts. All three analysis tools accept this same input. The runtime validator additionally enforces six-decimal micro-USD precision, the same task_id belonging to one workflow, one workflow when monthlyTasks is given, and UTF-16 length limits. HTTP body limit: 512000 UTF-8 bytes.
  - `runs` object[], required
    - `task_id` string, required: Nonempty, no control characters or surrounding whitespace. The engine additionally enforces at most 128 UTF-16 code units.
    - `workflow` string, required: Nonempty, no control characters or surrounding whitespace. The engine additionally enforces at most 80 UTF-16 code units.
    - `variant` 'baseline' | 'candidate', required
    - `cost_usd` number, required: USD cost of this attempt. At most six decimal places; the engine verifies whole micro-USD using floating-point tolerance. No multipleOf keyword is used, to avoid rejecting valid JSON decimals.
    - `success` boolean, required
    - `latency_ms` number: Recorded attempt duration in milliseconds; decimals are accepted. Omit if not measured.
  - `config` object
    - `minSamples` integer
    - `minSuccessRate` number
    - `maxSuccessRateDrop` number
    - `maxP95LatencyMs` number
    - `monthlyTasks` integer: Baseline logical tasks launched per month; the engine requires exactly one workflow if supplied.

## Response `200`

Conditional analysis, no realized-savings or deployment claim.

- object
  - `mode` 'free_audit', required
  - `payment_required` false, required
  - `persisted` false, required
  - `data` object, required
    - `schema_version` '1.0.0', required
    - `purpose` 'cost_per_successful_agent_task_audit', required
    - `data_provenance` 'user_supplied_not_verified', required
    - `config` object, required
      - `minSamples` integer, required
      - `minSuccessRate` number, required
      - `maxSuccessRateDrop` number, required
      - `maxP95LatencyMs` number
      - `monthlyTasks` integer: Baseline logical tasks launched per month; the engine requires exactly one workflow if supplied.
    - `input_attempt_records` integer, required
    - `experimental_bias_control` 'unknown', required
    - `automatic_deployment_authorized` false, required
    - `methodology` object, required
      - `logical_task_key` string[], required
      - `success` string, required
      - `duplicates` string, required
      - `latency` string, required
      - `quality` string, required
      - `uncertainty` string, required
      - `missing_costs` string, required
    - `workflows` object[], required
      - `workflow` string, required: Nonempty, no control characters or surrounding whitespace. The engine additionally enforces at most 80 UTF-16 code units.
      - `baseline` object, nullable, required
        - `tasks` integer, required
        - `attempts` integer, required
        - `retry_attempts` integer, required
        - `successful_tasks` integer, required
        - `total_cost_usd` number, required
        - `cost_per_task_usd` number, required
        - `cost_per_successful_task_usd` number, nullable, required
        - `success_rate` number, required
        - `success_rate_interval_95_wilson` number[], required
        - `p95_recorded_attempt_latency_per_task_ms` number, nullable, required
        - `latency_complete` boolean, required
      - `candidate` object, nullable, required
        - `tasks` integer, required
        - `attempts` integer, required
        - `retry_attempts` integer, required
        - `successful_tasks` integer, required
        - `total_cost_usd` number, required
        - `cost_per_task_usd` number, required
        - `cost_per_successful_task_usd` number, nullable, required
        - `success_rate` number, required
        - `success_rate_interval_95_wilson` number[], required
        - `p95_recorded_attempt_latency_per_task_ms` number, nullable, required
        - `latency_complete` boolean, required
      - `comparison` object, required
        - `matched_task_ids` integer, required
        - `baseline_only_tasks` integer, required
        - `candidate_only_tasks` integer, required
        - `same_task_set` boolean, required
      - `gates` object, required
        - `both_variants` 'pass' | 'fail' | 'unknown' | 'not_requested', required
        - `minimum_distinct_tasks_per_variant` 'pass' | 'fail' | 'unknown' | 'not_requested', required
        - `same_task_set` 'pass' | 'fail' | 'unknown' | 'not_requested', required
        - `observed_success_rate` 'pass' | 'fail' | 'unknown' | 'not_requested', required
        - `recorded_latency` 'pass' | 'fail' | 'unknown' | 'not_requested', required
        - `lower_cost_per_successful_task` 'pass' | 'fail' | 'unknown' | 'not_requested', required
        - `experimental_bias_control` 'unknown', required
      - `decision` 'missing_comparison' | 'collect_more_data' | 'quality_regression' | 'latency_data_required' | 'latency_regression' | 'no_economic_advantage' | 'candidate_for_controlled_trial', required
      - `automatic_deployment_authorized` false, required
      - `realized_savings_usd` unknown, required
      - `opportunity_monthly` object, nullable, required
        - `status` 'conditional_projection_not_realized', required
        - `basis` 'same_expected_successful_task_volume', required
        - `currency` 'USD', required
        - `period` 'month', required
        - `baseline_launched_tasks_per_month` integer, required
        - `expected_successful_tasks_per_month` number, required
        - `candidate_expected_launched_tasks_per_month` number, required
        - `baseline_expected_cost_usd` number, required
        - `candidate_expected_cost_usd` number, required
        - `potential_cost_difference_usd` number, required
        - `excludes` string[], required
        - `conditions` string[], required

## Other responses

- `400`: Invalid input
- `401`: Active test agent key required
- `413`: 512000-byte request limit exceeded

---

[API](https://skmtc.dev/alpnai/apis/alpnai-agent-api.md) · [All operations](https://skmtc.dev/alpnai/apis/alpnai-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/alpnai/apis/alpnai-agent-api/revisions/ab20b858b8d4?raw)
