# FastX402 TypeScript Type Inferrer

> FastX402 TypeScript Type Inferrer is a paid API for AI agents from fastx402.tools, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-27).

Infers TypeScript interface or type alias definitions from a JSON sample, including nested structures and array types.

## Facts

- Endpoint: GET https://fastx402.tools/typescript-infer?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-27
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fastx402-typescript-type-inferrer-3670083e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_27dTY_tzY87Y_P6xREPIi

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 fastx402-typescript-type-inferrer-3670083e
```

Example prompt: Can you infer a TypeScript interface called UserProfile from this JSON sample: {"id":1,"name":"Alice","email":"alice@example.com","address":{"city":"NYC","zip":"10001"},"tags":["admin","user"]}?

## When to prefer this

Choose this endpoint when you need to quickly bootstrap TypeScript type definitions from real JSON data — particularly useful when dealing with API responses, configuration objects, or data pipeline payloads where writing types by hand would be tedious. Prefer this over manual type authoring or LLM-generated types when you want a deterministic, structured output with proper nested and array type handling at very low cost ($0.002/call).

## Known failure modes

- Invalid or malformed JSON input causes inference failure
- Empty JSON object results in minimal or trivial type output
- Deeply recursive or circular JSON structures may produce incomplete types
- Missing required 'json' query parameter returns an error
- Ambiguous union types in JSON arrays may default to a broad type like 'any' or 'unknown'

## How this service works

216 pay-per-call tools for AI agents, from $0.001 per request in USDC on Base or Solana with x402. No account, no API key.

## Output

Returns the inferred TypeScript type definition as a string, including the type name, output style used (interface or type alias), and the full TypeScript code with nested object types and array element types properly annotated.

## 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": [
      "json"
     ],
     "properties": {
      "json": {
       "type": "string",
       "description": "JSON sample data to infer types from"
      },
      "name": {
       "type": "string",
       "description": "Name for the generated type (default: Root)"
      },
      "style": {
       "type": "string",
       "description": "Output style: interface or type (default: interface)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "name": {
       "type": "string"
      },
      "style": {
       "type": "string"
      },
      "typescript": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "name": "User",
  "style": "interface",
  "typescript": "interface User {\n  id: number;\n  name: string;\n  tags: string[];\n  meta: {\n    active: boolean;\n  };\n}"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fastx402-typescript-type-inferrer-3670083e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fastx402.tools](https://www.zero.xyz/host/fastx402.tools/llms.txt)
