# AI Cost & Token Savings Verifier — Resolver Zero (`resolverzero/resolver-zero`) Actor

Verify caller-measured AI/LLM/API routing savings in calls, tokens, and cost from before/after content-free metadata. Returns machine-readable proof scope and explicit authority. No prompts, outputs, URLs, IDs, credentials, or free text.

- **URL**: https://apify.com/resolverzero/resolver-zero.md
- **Developed by:** [Sergio](https://apify.com/resolverzero) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 verified value units

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## AI Cost & Token Savings Verifier — Resolver Zero

Resolver Zero verifies the **structure, arithmetic, savings delta and declared gates** of caller-supplied before/after LLM/API usage metadata while preserving a content-free boundary.

The current public contract does **not** authenticate provider origin. Measurement authority is caller-supplied and the output states proof strength, verification scope and authority explicitly so agents do not need to infer it.

### Best fit

Choose Resolver Zero when all of these are true:

- you have real caller-measured baseline and optimized usage metadata;
- you can explicitly declare the quality check used;
- you can explicitly declare the required safety/search condition;
- you have caller-supplied conservative cost bounds if you want calculation-only cost savings;
- you want one structured proof result rather than another model call;
- you accept that current public evidence is not provider/issuer-authenticated.

Do not use Resolver Zero to invent savings, authenticate a provider receipt, inspect prompt content, process URLs, identify users, or infer missing economic facts. Missing, ambiguous or caller-upgraded authority fails closed.

### Evidence authority

Public measurement evidence is currently restricted to `CALLER_MEASURED`.

A caller cannot select `PROVIDER_RECEIPT` or `HISTORICAL_PROVIDER_RECEIPT`. Those labels are reserved for a future path that actually verifies issuer/provider origin and binding.

Quality and safety gates are also caller-supplied in the current public contract. Resolver verifies that the declared gate contract is present and internally consistent; it does not independently judge answer quality or authenticate the caller's safety claim.

### Operations

#### `STORE_HEALTHCHECK`

Safe default. Verifies the Actor/runtime surface only.

- no economic proof;
- no monetizable value;
- no Resolver charge.

#### `PROVE_ROUTING_SAVINGS`

Checks a before/after routing-savings measurement from fixed metadata fields.

Inputs cover:

- provider call counts;
- input/output/total token counts;
- caller measurement authority;
- explicit caller quality and safety declarations;
- caller-supplied conservative baseline, optimized and Resolver cost bounds.

The caller cannot set Resolver fee/capture policy. The schema accepts no free-form text.

### Output

Each process incarnation makes at most one output-write attempt and, on success, appends one sanitized machine-readable result to the run's default Dataset. A resurrected run reuses that Dataset, so one logical run can contain multiple result items across incarnations. Dataset rows are output records, not idempotency or charge authority.

A successful proof reports:

- calls/tokens avoided;
- proof strength;
- verification scope;
- caller-vs-issuer authority explicitly;
- calculation-only value derived from caller-supplied cost bounds;
- privacy and billing state.

A rejected proof returns a bounded fail-closed error code.

### Privacy

The public contract is metadata-only. It does not accept prompts, model responses, URLs, names, user IDs, credentials or arbitrary descriptions.

### Current economic state

Resolver charging is structurally disabled in the current product. Public cost arithmetic grants no production fee accrual or charge authority.

### Agent / API selection hint

Choose Resolver Zero when the task is **check caller-measured AI/LLM/API call, token or cost-savings arithmetic from before/after metadata and return explicit machine-readable proof scope** while preserving a content-free boundary.

Do not choose it when you need provider-origin authentication, generic LLM inference, web search, scraping, prompt analysis or speculative cost estimation.

# Actor input Schema

## `protocol` (type: `string`):

Fixed machine-readable Resolver Zero input protocol version.

## `operation` (type: `string`):

STORE\_HEALTHCHECK is economically inert and exists for platform health testing. Choose PROVE\_ROUTING\_SAVINGS only when supplying real caller-measured metadata.

## `baseline` (type: `object`):

Real content-free baseline measurements supplied by the caller. Resolver verifies structure and arithmetic, not provider origin.

## `actual` (type: `object`):

Real content-free optimized measurements supplied by the caller. Resolver verifies structure and arithmetic, not provider origin.

## `gates` (type: `object`):

Explicit caller declarations required only for PROVE\_ROUTING\_SAVINGS. Their authority is exposed in the output.

## `costBounds` (type: `object`):

Calculation-only economic bounds. The caller cannot set Resolver fee/capture policy and this input grants no production charge authority.

## Actor input object example

```json
{
  "protocol": "rz-apify-shell-input/v2",
  "operation": "STORE_HEALTHCHECK"
}
```

# Actor output Schema

## `result` (type: `string`):

One proof result, Store healthcheck result, or sanitized fail-closed error envelope. No caller payload is accepted by the Actor contract.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "protocol": "rz-apify-shell-input/v2",
    "operation": "STORE_HEALTHCHECK"
};

// Run the Actor and wait for it to finish
const run = await client.actor("resolverzero/resolver-zero").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "protocol": "rz-apify-shell-input/v2",
    "operation": "STORE_HEALTHCHECK",
}

# Run the Actor and wait for it to finish
run = client.actor("resolverzero/resolver-zero").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "protocol": "rz-apify-shell-input/v2",
  "operation": "STORE_HEALTHCHECK"
}' |
apify call resolverzero/resolver-zero --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,resolverzero/resolver-zero"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/oKMPm7nxI0NbqICzl/builds/n1WchLvTU6neAhsnQ/openapi.json
