Skip to content
A Swagger API client generator based on axios and written in TypeScript. 🌊
TypeScript HTML JavaScript
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
src fix: Register Handlebars comparison helpers (#164) Dec 27, 2019
.editorconfig first commit Apr 26, 2019
.huskyrc.json refactor: Port Git hooks configuration to JSON (#75) Aug 9, 2019
.lintstagedrc.json fix: Normalize special characters in URL or keys (#155) Nov 11, 2019
.prettierignore feat: Add descriptions, fix data sending (#29) May 29, 2019
.yarnrc chore: Use npm registry with yarn (#98) Sep 4, 2019 docs: updated Dec 27, 2019 chore: Transfer repository to "welovecoding" organization (#158) Nov 12, 2019
logo.png docs: Update logo subtitles May 24, 2019
package.json chore(deps): bump handlebars from 4.5.3 to 4.7.2 (#175) Feb 1, 2020
tsconfig.json fix: Ignore TS test files (#97) Sep 3, 2019
tslint.json feat: Copy templates when building and upgrade packages (#13) May 24, 2019



A Swagger API client generator based on axios and written in TypeScript.


You can install Swaxios globally (npm i -g swaxios) or add it to your devDependencies.

Your targeted project must also have a recent version of axios and TypeScript:

npm i axios
npm i -D typescript


Display all CLI options:

swaxios --help

If you pass an OpenAPI Specification (OAS) (v2.0; JSON or YAML) to Swaxios, then it generates an API client that uses axios under the hood and is written in TypeScript:

# Provide a Swagger input file (JSON or YAML)
swaxios -i ./path/to/swagger.json -o ./path/to/output/directory
swaxios -i ./path/to/swagger.yml -o ./path/to/output/directory

# Alternative: Provide a URL to a Swagger endpoint
swaxios -i -o ./path/to/output/directory

With the -f option, you can force Swaxios to overwrite existing files in the output path:

swaxios -i ./path/to/swagger.json -o ./path/to/output/directory -f


You can find many examples of generated API client code in our snapshots section.

Here is a basic example:


/* tslint:disable */

 * This file was automatically generated by "Swaxios".
 * It should not be modified by hand.

import {AxiosInstance, AxiosRequestConfig} from 'axios';

export class ExchangeService {
  private readonly apiClient: AxiosInstance;

  constructor(apiClient: AxiosInstance) {
    this.apiClient = apiClient;

  deleteExchange = async (id: number): Promise<void> => {
    const config: AxiosRequestConfig = {
      method: 'delete',
      url: `/api/v1/exchange/${id}`,
    await this.apiClient.request(config);

It has been generated from the following path:


  // ...
  "paths": {
    "/api/v1/exchange/{id}": {
      "delete": {
        "consumes": ["application/json"],
        "operationId": "deleteExchange",
        "parameters": [
            "in": "path",
            "name": "id",
            "required": true,
            "type": "number"
        "produces": ["application/json"],
        "responses": {
          "200": {
            "description": ""
  // ...


This project is inspired by swagger-codegen.

You can’t perform that action at this time.