DEV Community

Jack Green
Jack Green

Posted on Originally published at tools.jackgreen.top

Stoplight Alternative: Free OpenAPI to TypeScript Client Generator

Stoplight Alternative: Free OpenAPI to TypeScript Client Generator

Tired of paying $200+/year for Stoplight just to generate TypeScript client code from your OpenAPI specs?

I built a completely free, browser-based alternative that works offline with no signup required.

The Problem

Stoplight, Swagger Codegen, and similar tools are powerful but come with baggage:

  • Expensive — $200-300+ per seat per year
  • Requires account — can't just paste and go
  • Cloud-only — your API specs get uploaded to their servers
  • Watermarked — free tier adds branding to output

The Solution

A pure client-side tool that:

  • Parses OpenAPI 3.x specs (JSON or YAML) in your browser
  • Generates TypeScript interfaces for all schemas
  • Creates typed request/response types for each endpoint
  • Optionally builds a complete API client class (fetch or axios)
  • Works 100% offline — no data leaves your computer
  • Completely free forever — no account, no payment, no watermark

Features

Type-Safe Interfaces

Convert all your OpenAPI schemas to TypeScript interfaces automatically. Supports:

  • Object types with nested properties
  • Array types
  • Enum values as TypeScript union types
  • oneOf/allOf/anyOf composition

Request/Response Types

Automatically generate typed interfaces for:

  • Request bodies
  • Path parameters
  • Query parameters
  • Success responses

Optional API Client

Generate a ready-to-use TypeScript client class with:

  • Typed methods for each endpoint
  • Automatic path parameter substitution
  • Configurable base URL
  • Optional headers support
  • fetch or axios implementation

Download or Copy

One-click copy to clipboard or download as .ts file.

Try It

👉 Generate TypeScript Code Now

How It Works

  1. Paste your spec — JSON or YAML format
  2. Configure options — namespace prefix, client type
  3. Generate — get typed TypeScript code instantly
  4. Copy or download — use in your project

Example Output

Given this OpenAPI spec:

{
  "openapi": "3.0.0",
  "info": { "title": "User API", "version": "1.0.0" },
  "paths": {
    "/users/{id}": {
      "get": {
        "operationId": "getUser",
        "parameters": [{ "name": "id", "in": "path" }],
        "responses": { "200": { "description": "User" } }
      }
    }
  },
  "components": {
    "schemas": {
      "User": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "name": { "type": "string" }
        }
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

You get:

export interface User {
  id: string;
  name: string;
}

export interface GetUserRequest {
  pathParams: { id: string };
}

export type GetUserResponse = User;

export class ApiClient {
  async getUser(params: { id: string }): Promise<unknown> {
    // ... generated client code
  }
}
Enter fullscreen mode Exit fullscreen mode

Why Free?

I believe developer tools should be accessible. This tool is:

  • Open source — check the code
  • No tracking — your specs never leave your browser
  • No ads — just useful code generation
  • Community-driven — suggestions welcome

Tech Stack

  • Vanilla JavaScript (no frameworks)
  • js-yaml for YAML parsing
  • Pure client-side processing
  • Single HTML file deployment

GitHub

Full source code available on GitHub. Contributions welcome!


Try it free: https://tools.jackgreen.top/n-openapi-to-typescript-client-code-generator-as-a/

Top comments (0)