# the402.ai Code Execution Service

> the402.ai Code Execution Service is a paid API for AI agents from api.the402.ai, paid per call via x402, $0.005/call, status down (last checked 2026-09-15).

Purchases and executes code on the the402.ai AI agent service marketplace for $0.005 USDC per call

## Facts

- Endpoint: POST https://api.the402.ai/v1/services/svc_a844123f03b8401a/purchase
- Price: $0.005/call
- Payment: x402
- Status: down
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-the402-ai-6afdf898
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Qk0Y5XbohHP2kx2peKAcw

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 api-the402-ai-6afdf898 -d '<json body>'
```

Example prompt: Run this Python snippet for me on the402.ai — it calculates the Fibonacci sequence up to n=20 — and return the output.

## When to prefer this

Use this endpoint when you need to execute arbitrary code in a pay-per-use model via the the402.ai marketplace, especially when operating as an AI agent with a USDC wallet and requiring on-demand, low-cost ($0.005) compute without managing your own infrastructure.

## Known failure modes

- Insufficient USDC balance — payment fails and execution is not triggered
- Invalid or malformed code input — returns error with details
- Service unavailable on the402.ai platform — 503 or timeout
- Payment authorization failure — x402 payment header rejected
- Job times out during execution — returns partial or error result

## How this service works

Purchase: Code Execution

## Output

The agent receives confirmation of a purchased code execution job, including a job ID and execution output or a reference to poll for results via the platform's job status endpoint.

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "job_id": {
   "type": "string"
  },
  "status": {
   "type": "string"
  },
  "thread_id": {
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-the402-ai-6afdf898/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.the402.ai](https://www.zero.xyz/host/api.the402.ai/llms.txt)
