# Environment Diff

> Environment Diff is a paid API for AI agents from api.zfinia.com, paid per call via x402, $0.09/call, status unknown (last checked 2026-10-10).

Compares two sets of environment variables and reports additions, removals, and changes using structural metadata (length, character classes) without revealing actual values — safe for staging vs. production comparisons.

## Facts

- Endpoint: POST https://api.zfinia.com/x402/v1/env-diff?utm_source=zero.xyz
- Price: $0.09/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/environment-diff-3e9ca8a7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zU9L80yE2TBpoCCDBJTmL

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 environment-diff-3e9ca8a7 -d '<json body>'
```

Example prompt: Can you diff my staging and production environment variables — I'll give you both sets as objects — and tell me what was added, removed, or changed, flagging anything that looks like a new credential or became empty? Don't show me the actual values, just the structural changes.

## When to prefer this

Choose this endpoint when you need to audit environment variable changes between two environments (e.g. staging vs. production) without exposing secret values — particularly in CI/CD pipelines, security audits, or incident investigations where value confidentiality is mandatory. Prefer it over plain text diffs or manual comparison when you need structured, machine-readable output that flags credential-shaped additions or empty-value regressions automatically.

## Known failure modes

- Missing 'before' or 'after' object returns a validation error
- Oversized environment objects may exceed payload limits
- Payment failure (x402 protocol) blocks the call before processing
- Non-object values for 'before' or 'after' fields cause schema rejection
- Network timeouts if upstream infrastructure is unavailable

## How this service works

Compare two sets of environment variables without revealing either side. Reports what was added, removed and changed, and describes each change by length and character classes rather than by value, so it is safe to run between staging and production. Flags a value that became empty, a value whose character classes changed, and a new variable shaped like a credential.

## Output

Returns a structured diff of the two environment variable sets: lists of added, removed, and changed variable names; for each change, a structural description (length delta, character class shift such as alphanumeric vs. base64 vs. hex); a flag if a value became empty; a flag if character classes changed; and a flag if any newly added variable resembles a credential — all without exposing the actual values of either environment.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "after": {
   "type": "object"
  },
  "before": {
   "type": "object"
  },
  "after_name": {
   "type": "string",
   "maxLength": 64
  },
  "before_name": {
   "type": "string",
   "maxLength": 64
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/environment-diff-3e9ca8a7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.zfinia.com](https://www.zero.xyz/host/api.zfinia.com/llms.txt)
