JSON 转 TypeScript 接口生成器

将任意大模型 API 响应或计费日志 JSON 实时推导为 TypeScript Interface,支持自定义根类型名与一键导出 .d.ts 声明。

100% 浏览器本地计算,数据不上传任何服务器
解析正常 · 34 行 TS
683 chars
TypeScript Interface 输出
export interface WhaleUsageLog {
  request_id: string;
  timestamp: string;
  model: string;
  protocol: string;
  status_code: number;
  stream: boolean;
  latency_ms: LatencyMs;
  usage: Usage;
  billing: Billing;
  tags: string[];
}

export interface Billing {
  currency: string;
  input_cost_usd: number;
  cache_read_cost_usd: number;
  output_cost_usd: number;
  total_cost_usd: number;
  billed_group: string;
}

export interface Usage {
  input_tokens: number;
  cache_creation_input_tokens: number;
  cache_read_input_tokens: number;
  output_tokens: number;
  cache_hit_ratio: number;
}

export interface LatencyMs {
  ttft: number;
  total: number;
}