# Toll402 Forge — On-Demand Tool Generator

> Toll402 Forge — On-Demand Tool Generator is a paid API for AI agents from toll402.dev, paid per call via x402, $0.25/call, status unknown (last checked 2026-09-14).

Generates, sandboxes, and publishes a new paid API endpoint from a description, input schema, and test examples

## Facts

- Endpoint: GET https://toll402.dev/v1/forge
- 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/toll402-forge-on-demand-tool-generator-efd1c1de
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_v7D_7WrgToxfUdAvoZaJT

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 toll402-forge-on-demand-tool-generator-efd1c1de
```

Example prompt: Create a new tool called 'hex-to-rgb' that converts a hex color string to its RGB components — describe it as 'Converts a hex color code like #FF5733 to an RGB object', set the input schema to accept a field called hex (string), provide one test example with input {"hex":"#FF5733"} and expected output {"r":255,"g":87,"b":51}, and price it at $0.005 per call.

## When to prefer this

Use this endpoint when you need to dynamically create and publish a brand-new callable tool at runtime — especially when no existing endpoint matches your needs and you want it immediately available to all agents as a paid micro-API. Prefer this over static tool registries when the tool logic can be described in a short description and validated with a few examples. Not suitable for tools requiring private API keys, persistent databases, or complex multi-step orchestration.

## Known failure modes

- Sandbox test cases fail after 3 generation attempts — tool is not published and error details are returned
- Invalid or incomplete input schema causes a validation error before code generation
- Tool name too short (<3 chars), too long (>40 chars), or already taken — returns a conflict or validation error
- Generated code calls disallowed network resources when allowNetwork is false
- Price outside allowed range (0.001–0.05 USD) triggers validation failure
- Description too short (<20 chars) or too long (>1000 chars) returns a schema error

## How this service works

Create a NEW tool from a description, an input schema and test examples. The code is generated, run in a sandbox against your examples (up to 3 attempts), and on success published as a paid endpoint /v1/t/<name> for every agent. Infinite tools, on demand.

## Output

Returns a JSON object indicating whether the tool was successfully generated and published, including the new endpoint slug (e.g. /v1/t/<name>), sandbox run outcomes across up to 3 attempts, execution time in milliseconds, and the tool's metadata (description, price, tags, creator).

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "name",
      "description",
      "inputSchema",
      "examples"
     ],
     "properties": {
      "name": {
       "type": "string",
       "maxLength": 40,
       "minLength": 3,
       "description": "Tool name (becomes the endpoint slug)"
      },
      "tags": {
       "type": "array",
       "items": {
        "type": "string",
        "maxLength": 30
       },
       "default": [],
       "maxItems": 8
      },
      "creator": {
       "type": "string",
       "maxLength": 80,
       "description": "Your wallet address or agent id, for attribution"
      },
      "examples": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "input"
        ],
        "properties": {
         "input": {
          "type": "object",
          "additionalProperties": true
         },
         "expectedOutput": {}
        },
        "additionalProperties": false
       },
       "maxItems": 5,
       "minItems": 1,
       "description": "Test cases; the tool must pass them to be published"
      },
      "priceUsd": {
       "type": "number",
       "default": 0.005,
       "maximum": 0.05,
       "minimum": 0.001,
       "description": "Price per call for other agents (you never pay to use your own tool's endpoint less than this either)"
      },
      "description": {
       "type": "string",
       "maxLength": 1000,
       "minLength": 20,
       "description": "What the tool does, precisely. Mention data sources (public URLs/APIs without keys) if any."
      },
      "inputSchema": {
       "type": "object",
       "description": "JSON Schema (type object) for the input",
       "additionalProperties": true
      },
      "allowNetwork": {
       "type": "boolean",
       "default": true,
       "description": "Whether the tool may call public HTTP endpoints"
      },
      "outputSchema": {
       "type": "object",
       "description": "JSON Schema for the output (recommended)",
       "additionalProperties": true
      }
     },
     "additionalProperties": false
    }
   },

… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "tool": {
   "url": "https://toll402.dev/v1/t/hn_top",
   "name": "hn_top",
   "price": "$0.005"
  },
  "attempts": 1,
  "published": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/toll402-forge-on-demand-tool-generator-efd1c1de/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from toll402.dev](https://www.zero.xyz/host/toll402.dev/llms.txt)
