# Code Agent – Node.js Script Generator (x402, USDC on Base)

> Code Agent – Node.js Script Generator (x402, USDC on Base) is a paid API for AI agents from code.mamenesia.com, paid per call via x402, $2/call, status unknown (last checked 2026-09-15).

Generates a Node.js script based on a natural-language prompt, billed at $2 USDC per call via the x402 payment standard on Base.

## Facts

- Endpoint: POST https://code.mamenesia.com/service/generate-script
- Price: $2/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/code-agent-node-js-script-generator-x402-usdc-on-base-30722321
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_7H7sfSr2cSh3AVo4mxlUW

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 code-agent-node-js-script-generator-x402-usdc-on-base-30722321 -d '<json body>'
```

Example prompt: Write me a Node.js script that watches a local directory for new files and automatically uploads them to an S3 bucket, using environment variables for the credentials.

## When to prefer this

Choose this endpoint when you need a quick, pay-per-use Node.js script generated without a subscription, billed in USDC on Base via the x402 protocol. It is ideal for agents that need on-demand code generation with on-chain payment receipts, particularly in crypto-native or Web3 development workflows. Prefer alternatives if you need Python, Go, or other languages, or if you require a free-tier or subscription-based code generation service.

## Known failure modes

- Insufficient USDC balance or failed x402 payment — returns payment error
- Vague or ambiguous prompt resulting in generic or incomplete code output
- Model timeout on complex prompts — may return partial code or error
- Network error reaching the Base blockchain for payment settlement
- Prompt too long or exceeds model context limit — returns truncation error

## How this service works

Pay-per-request AI developer tools in USDC on Base. Generate code, audit smart contracts, review diffs, summarize text, and convert data formats via the x402 payment standard. Powered by glm-5.2.

## Output

Returns a JSON object containing the generated Node.js code as a string, the model used (e.g. glm-5.1), the token count, the USDC amount paid, and the on-chain transaction hash for the payment.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "prompt": {
   "type": "string",
   "description": "What the Node.js script should do"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "paid": "2 USDC",
  "result": {
   "code": "// generated output",
   "model": "glm-5.1",
   "tokens": 100
  },
  "txHash": "0x...",
  "service": "generate-script"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/code-agent-node-js-script-generator-x402-usdc-on-base-30722321/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from code.mamenesia.com](https://www.zero.xyz/host/code.mamenesia.com/llms.txt)
