# Strale JSON to TypeScript Converter

> Strale JSON to TypeScript Converter is a paid API for AI agents from api.strale.io, paid per call via x402, $0.054/call, status unknown (last checked 2026-09-15).

Converts a JSON string or object into TypeScript type definitions

## Facts

- Endpoint: GET https://api.strale.io/x402/v2/json-to-typescript
- Price: $0.054/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/strale-json-to-typescript-converter-c5e3285a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oF6Nk_6GloeC9Iu9zL-_1

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 strale-json-to-typescript-converter-c5e3285a
```

Example prompt: Take this JSON object and convert it into TypeScript type definitions for me — use 'UserProfile' as the root type name and export the types: {"id": 1, "name": "Alice", "email": "alice@example.com", "roles": ["admin","user"]}

## When to prefer this

Choose this endpoint when you need a quick, on-demand TypeScript type generation from a raw JSON payload without setting up local tooling. Ideal for agents scaffolding TypeScript projects, validating API response shapes, or generating type-safe interfaces from dynamic data. Particularly useful when combined with audit trail requirements, since every call returns a cryptographic audit record.

## Known failure modes

- Invalid or malformed JSON input causes a parsing error
- Missing required 'json' query parameter returns a 400-level error
- Deeply nested or extremely large JSON objects may produce incomplete or truncated type output
- Ambiguous JSON types (e.g. mixed-type arrays) may result in union types or 'any'
- Payment failure or insufficient USDC balance prevents the call from completing

## How this service works

The trust layer for AI agents — 250+ independently tested data capabilities across 27 countries. Execute capabilities via REST, MCP, A2A, or x402 micropayments. Every call returns an audit record with cryptographic chain hashing.

## Output

Returns TypeScript type definitions (interfaces or type aliases) inferred from the provided JSON structure, with optional export keywords and a customizable root type name.

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "json"
     ],
     "properties": {
      "json": {
       "description": "JSON string or object"
      },
      "export": {
       "type": "boolean"
      },
      "root_name": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/strale-json-to-typescript-converter-c5e3285a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
