# Sasona Code Runner

> Sasona Code Runner is a paid API for AI agents from router.sasona.ai, paid per call via x402, $0.0079/call, status unknown (last checked 2026-11-11).

Executes arbitrary code by proxying an HTTP request through the Sasona router, returning the result of the code execution

## Facts

- Endpoint: POST https://router.sasona.ai/x402/run-code?utm_source=zero.xyz
- Price: $0.0079/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/sasona-code-runner-9920cde8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Uw-VFLO4109KXLGh5Y4kM

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 sasona-code-runner-9920cde8 -d '<json body>'
```

Example prompt: Run this code through Sasona — send a POST request with a JSON body containing my payload object and return whatever the execution produces.

## When to prefer this

Choose this endpoint when you need to execute arbitrary code or invoke remote logic through a managed HTTP proxy with per-call micropayment billing. It is best suited for agentic workflows that need to run dynamic computations, trigger serverless functions, or offload processing without managing infrastructure. Prefer this over generic serverless platforms when you need a pay-per-call model integrated with x402 payment rails.

## Known failure modes

- Missing required 'input' field returns validation error
- Invalid HTTP method (e.g. GET) rejected by enum constraint
- Malformed JSON body causes parsing failure
- Execution timeout if code runs too long
- Authentication or payment failure via x402 protocol
- Unsupported bodyType value outside json/form-data/text enum

## How this service works

Run code through Sasona

## Output

The agent receives a response object from the code execution, containing the output or result produced by the executed code. The structure depends on the code being run, but is returned as a typed output object potentially including an example payload.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object"
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/sasona-code-runner-9920cde8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from router.sasona.ai](https://www.zero.xyz/host/router.sasona.ai/llms.txt)
