# Generate Tutorial — Code Agent (x402, USDC on Base)

> Generate Tutorial — Code Agent (x402, USDC on Base) is a paid API for AI agents from code.mamenesia.com, paid per call via x402, $0.25/call, status unknown (last checked 2026-09-14).

Generates a step-by-step coding tutorial on a given topic, powered by GLM-5.2 and billed at $0.25 USDC per call via the x402 payment standard.

## Facts

- Endpoint: POST https://code.mamenesia.com/service/generate-tutorial
- Price: $0.25/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/generate-tutorial-code-agent-x402-usdc-on-base-17efb2c7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_C5Mv9OIPLv3RjZt8wdBm4

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 generate-tutorial-code-agent-x402-usdc-on-base-17efb2c7 -d '<json body>'
```

Example prompt: Generate a step-by-step coding tutorial on building a REST API with Python Flask — write it in English.

## When to prefer this

Choose this endpoint when you need an AI-generated, structured coding tutorial on a specific programming topic and want to pay per request without a subscription, using USDC on Base via the x402 standard. It is particularly useful for agents automating developer onboarding content, documentation generation, or educational material pipelines in a trustless, pay-per-use fashion.

## Known failure modes

- Payment failure: insufficient USDC balance or invalid x402 payment header returns 402 Payment Required
- Missing topic field: request without a topic may return a 400 Bad Request or empty/generic output
- Model unavailability: if GLM backend is down, may return 500 Internal Server Error
- Language not supported: unusual language codes may fall back to English silently
- Rate limiting: high-frequency requests from same wallet may be throttled

## 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 tutorial content (code and explanatory text) under result.code, the model used (e.g. glm-5.1), token count consumed, the x402 transaction hash confirming the $0.25 USDC payment, and the service name 'generate-tutorial'.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "topic": {
   "type": "string",
   "description": "Tutorial topic"
  },
  "language": {
   "type": "string",
   "default": "English",
   "description": "Natural language"
  }
 }
}
```

## Response schema (JSON Schema)

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

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/generate-tutorial-code-agent-x402-usdc-on-base-17efb2c7/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)
