Generate SDKs from OpenAPI

Generating the first SDK with Speakeasy takes no more than a few minutes. Follow these steps to get started.

Sign up for Speakeasy

First, sign up for a free Speakeasy (opens in a new tab) account.

New accounts start with a 14-day free trial of Speakeasy’s business tier, so that users can try out every SDK generation feature. At the end of the trial, accounts will revert to the free tier. No credit card is required.

Free accounts can continue to generate one SDK with up to 50 API methods free of charge.


Install the Speakeasy CLI

After signing up, install the Speakeasy CLI using one of the following methods:

Homebrew
# Homebrew (macOS)
brew install speakeasy-api/homebrew-tap/speakeasy

For manual installation, download the latest release from the releases page (opens in a new tab), extract the binary, and add it to the system path.


Run the Speakeasy quickstart command

For first-time SDK generation, run speakeasy quickstart.

speakeasy quickstart

Authenticate your Speakeasy account using the CLI prompts. Then, in the browser window that opens, select a workspace to associate with the CLI. You can always change workspaces later.


Upload an OpenAPI document

After authentication, the CLI prompts for an OpenAPI document:

Screenshot of the terminal after running speakeasy quickstart.

Enter either a link to a remote-hosted OpenAPI document or a relative path to a local file in one of the supported formats:

Specification formatSupported
OpenAPI 3.0
OpenAPI 3.1
JSON Schema
Success Icon

TIP

If your specification is in an unsupported format, use one of the following tools to convert it:


Specify an SDK name and language

After configuring the OpenAPI document, the CLI prompts for an SDK name. It’s best to name the SDK after the company or project it’s being used for.

Screenshot of the terminal with optional parameters.

The CLI then provides a language selection prompt.

Screenshot of the terminal prompting user to select language.

For each supported language, Speakeasy has worked with language experts to craft generators that produce highly idiomatic code. The links below provide more information about the design decisions behind each language implementation:

Specify a package name and output directory

To complete the SDK configuration, set a package name and output directory.

The CLI infers an SDK package name from the OpenAPI document, which can be overwritten if necessary. This package name only becomes relevant when publishing the SDK package.

The CLI then prompts for the output directory for the generated SDK.

Screenshot of the terminal with optional parameters.

Speakeasy validates the specifications and generates the SDK after receiving all inputs. The process executes speakeasy run to validate, generate, compile, and set up the SDK. Upon successful completion, a confirmation message displays the details of the generated SDK:

Screenshot of the terminal showing success.


Iterate on the SDK

After successful SDK generation, a CLI prompt appears asking to open the SDK in Speakeasy Studio. The Studio is a web GUI that helps improve the look and feel of SDKs. It uses OpenAPI overlays to preserve the original OpenAPI document, while allowing changes to the generated SDK.

Changes saved in the Studio automatically trigger a regeneration of the SDK locally.

Changes can also be made without the Studio. Find all the details in the guide to customizing SDKs.

Next step: Upload your SDK to GitHub

Once the SDK looks good, follow the Speakeasy guide to setting up an SDK on GitHub.