Skip to main content
OpenAPI TypeScript is configured using a configuration file in your project root. The CLI automatically detects and loads your configuration from supported file formats.

Configuration File

Create a configuration file in your project root using one of these formats:
The defineConfig helper provides TypeScript autocomplete and type checking for your configuration.

Core Configuration Options

Every configuration requires at minimum an input and output:
string | object | array
required
Path to your OpenAPI specification. Can be a local file path, URL, or API registry shorthand.See Input Configuration for details.
string | object | array
required
Path to the output folder where generated files will be written.See Output Configuration for details.
array
default:"['@hey-api/typescript', '@hey-api/sdk']"
Plugins generate artifacts from your OpenAPI specification. By default, TypeScript types and SDK functions are generated.See Plugins Configuration for details.
object
Customize how the OpenAPI specification is parsed and transformed before plugins process it.See Parser Configuration for details.

Additional Options

string
Path to the config file. Set this if you don’t use the default config file name, or it’s not located in the project root.
boolean
default:false
Skip writing files to disk. Useful for testing configuration without generating output.
boolean
default:false
Show an interactive error reporting tool when the program crashes. Generally kept disabled.
string | object
default:"process.cwd()"
Configure logging behavior.

Multiple Configurations

You can export an array of configurations to generate multiple outputs from different inputs:
openapi-ts.config.ts

Async Configuration

The defineConfig helper supports async functions for dynamic configuration:
openapi-ts.config.ts

Next Steps

Input Configuration

Configure how OpenAPI specifications are loaded

Output Configuration

Control where and how files are generated

Parser Configuration

Transform and filter your OpenAPI specification

Plugins Configuration

Choose what artifacts to generate