# Transaction Simulation (Dry-Run Before Signing)

> Transaction Simulation (Dry-Run Before Signing) is a paid API for AI agents from x402-services-production.up.railway.app, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-14).

Simulates an EVM transaction to predict whether it will succeed or revert, returning the revert reason, return data, and decoded action — without spending gas.

## Facts

- Endpoint: POST https://x402-services-production.up.railway.app/api/safety/simulate
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/transaction-simulation-dry-run-before-signing-b3edeadb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rlHpWakd6rtuFuyLBGsxk

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 transaction-simulation-dry-run-before-signing-b3edeadb -d '<json body>'
```

Example prompt: Before I sign this transaction, can you simulate it on Base to check if it'll succeed or revert? The target is 0xAbCd...1234, the calldata is 0xa9059cbb...0064, sent from 0xMySelf...5678 with 0 value.

## When to prefer this

Use this endpoint when an AI agent or user wants to pre-flight an EVM transaction before signing or broadcasting it — especially when the calldata is complex, the user is unsure whether a contract call will succeed, or you need to decode what a transaction actually does. Prefer this over just broadcasting when gas safety or user confirmation is important.

## Known failure modes

- Invalid or malformed 'to' address returns a 400 error
- Unsupported chain identifier causes a lookup failure
- Malformed calldata may result in an undecodeable action with partial results
- Simulation against stale state may not reflect real-time chain conditions
- Missing required 'to' field returns a validation error

## How this service works

Transaction simulation: will this tx succeed or revert, and why? Returns success/revert reason, return data, and decoded action. Send { chain, to, data, from?, value? }. Dry-run before signing.

## Output

Returns whether the transaction would succeed or revert, the revert reason string if it would fail, raw return data, and a decoded human-readable description of the action being performed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "to"
 ],
 "properties": {
  "to": {
   "type": "string",
   "description": "0x target address"
  },
  "data": {
   "type": "string",
   "description": "0x calldata"
  },
  "from": {
   "type": "string",
   "description": "0x sender"
  },
  "chain": {
   "type": "string",
   "description": "Chain, default base"
  },
  "value": {
   "type": "string",
   "description": "Native value in wei"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/transaction-simulation-dry-run-before-signing-b3edeadb/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-services-production.up.railway.app](https://www.zero.xyz/host/x402-services-production.up.railway.app/llms.txt)
