JSON to TypeScript converter

Paste a sample response to infer its TypeScript types. Include several records in an array to capture fields that only some records have.

Input

No key required

Result

Example

export interface Cat {
  id: number;
  name: string;
  born: string;
  owner: Owner;
}

export interface Owner {
  name: string;
  email: string;
}
Full response
{
  "to": "typescript",
  "output": "export interface Cat {\n  id: number;\n  name: string;\n  born: string;\n  owner: Owner;\n}\n\nexport interface Owner {\n  name: string;\n  email: string;\n}\n"
}

Run with curl

Copy this command to run the request in your terminal. It updates as you edit the input.

For higher limits, get a free API key and add -H "Authorization: Bearer $KAMINEKO_API_KEY".

POST /v1/types
curl 'https://api.kamineko.dev/v1/types' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "sample": {
    "id": 7,
    "name": "Mochi",
    "born": "2021-04-01",
    "owner": {
      "name": "Ada",
      "email": "ada@example.com"
    }
  },
  "name": "Cat",
  "to": "typescript"
}'

Use with MCP

Set KAMINEKO_API_KEY to your key and run this command to connect Claude Code. Try the types tool with this prompt.

Write TypeScript types for this API response.
MCP https://api.kamineko.dev/mcp
claude mcp add --transport http kamineko \
  https://api.kamineko.dev/mcp \
  --header "Authorization: Bearer $KAMINEKO_API_KEY"