# Coockies.ai Code Execution API

> Coockies.ai Code Execution API is a paid API for AI agents from coockies-ai.vercel.app, paid per call via x402, $0.2/call, status unknown (last checked 2026-09-21).

Executes arbitrary code remotely and returns the result, billed per-call via x402 on Base chain

## Facts

- Endpoint: POST https://coockies-ai.vercel.app/api/code-exec
- Price: $0.2/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/coockies-ai-code-execution-api-318b07a6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_nzCH2luih8Z_XOt4ezY4a

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 coockies-ai-code-execution-api-318b07a6 -d '<json body>'
```

Example prompt: Can you run this code snippet for me and return the output? Here's the logic I want executed: `result = sum([1, 2, 3, 4, 5]); return result`

## When to prefer this

Use this endpoint when you need to execute code dynamically in a cloud environment without provisioning your own infrastructure, and when you want to pay only per execution call using USDC on Base chain via x402 protocol. Prefer this over self-hosted solutions when minimizing setup overhead is a priority for AI agent workflows.

## Known failure modes

- Malformed or missing input object causes 400 error
- Code execution timeout if snippet runs too long
- Payment failure on Base chain causes 402 error
- Internal execution sandbox error returns 500
- Unsupported language or syntax causes execution failure

## How this service works

194 production-ready API endpoints. AI, Search, Social, Finance, Crypto. Pay-per-call with x402 on Base chain.

## Output

Returns a JSON object with a `result` field containing the output data from the executed code, structured as `{result: {data: ...}}`

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "result": {
   "type": "object",
   "description": "API response data"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "example": {
  "result": {
   "data": "example response"
  }
 },
 "properties": {
  "result": {
   "type": "object",
   "description": "API response data"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/coockies-ai-code-execution-api-318b07a6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from coockies-ai.vercel.app](https://www.zero.xyz/host/coockies-ai.vercel.app/llms.txt)
