# 24K Labs AI Automation Script Generator

> 24K Labs AI Automation Script Generator is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.35/call, status unknown (last checked 2026-09-15).

Generates automation scripts (e.g. Python, Bash) from a description or code input, powered by Claude Sonnet, billed per request in USDC on Base L2

## Facts

- Endpoint: POST https://api.24klabs.ai/api/automation-script
- Price: $0.35/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/24k-labs-ai-automation-script-generator-0c1d29fc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xEbz3Q0pcztlBOBVHIzcx

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 24k-labs-ai-automation-script-generator-0c1d29fc -d '<json body>'
```

Example prompt: Write me a Python automation script that monitors a folder for new CSV files and sends an email alert whenever one appears — pay per request, no API key needed.

## When to prefer this

Choose this endpoint when you need a ready-to-run automation script generated on demand without subscribing to a platform or managing API keys — ideal for agents that need pay-as-you-go code generation billed in USDC on Base L2. Best for file monitoring, scheduled tasks, notification pipelines, and other scripted automation tasks where Claude Sonnet's code generation quality is preferred.

## Known failure modes

- Missing or empty 'code' field may result in a vague or unusable script output
- Unsupported or misspelled 'language' value may cause the model to default to Python
- Overly vague context may produce a generic script that does not match the desired automation
- Payment failure via x402/USDC on Base L2 will block the request entirely
- Rate limiting or model unavailability may cause intermittent 500 errors

## How this service works

A curated directory of x402 services — each one on the list on purpose, with the health, uptime, and independent trust grades from across the ecosystem gathered in one place.

## Output

Returns a JSON object containing the generated automation script as a string (e.g. a complete Python or Bash script), the model used (claude-sonnet-4-5), and the number of tokens consumed in the request.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "code": {
   "type": "string",
   "description": "Primary input content"
  },
  "context": {
   "type": "string",
   "description": "Optional context or instructions"
  },
  "language": {
   "type": "string",
   "description": "Programming language (code services)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "model": "claude-sonnet-4-5",
  "result": "#!/usr/bin/env python3\nimport watchdog, smtplib...",
  "tokens_used": 530
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/24k-labs-ai-automation-script-generator-0c1d29fc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
