Speakeasy Logo
Skip to Content
DocumentationGenerate SDKs

Generate SDKs from OpenAPI

This page documents using the Speakeasy CLI to generate SDKs from OpenAPI / Swagger specs.

For a more UI-based experience, use the Speakeasy Sandbox:

Sign up for Speakeasy

First sign up for a free Speakeasy account at https://app.speakeasy.com .

New accounts start with a 14 day free trial of Speakeasy’s business tier, to enable users to 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:

For manual installation, download the latest release from the releases page , extract the binary, and add it to the system path.


Speakeasy Quickstart

For first-time SDK generation, run speakeasy quickstart.

The CLI will prompt for authentication with a Speakeasy account. A browser window will open to select a workspace to associate with the CLI. Workspaces can be changed later if required.


Upload an OpenAPI document

After authentication, the system prompts for an OpenAPI document:

Screenshot of the terminal after running speakeasy quickstart.

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

Spec Format
OpenAPI 3.0
Supported
OpenAPI 3.1
Supported
JSON Schema
Supported

Select an SDK language

After configuring the OpenAPI document, the next step prompt is to name the SDK. It’s best to name the SDK after the company or project it serves.

Choose target language:

Screenshot of the terminal prompting user to select language.

For each language,Speakeasy has crafted generators with language experts to be highly idiomatic. Follow the links below for all the details on the design decisions that have gone into each language we support:

Complete the SDK configuration

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. A confirmation message displays the generated SDK details upon successful completion:

Screenshot of the terminal showing success.

Iterating on the SDK

If the SDK is successfully generated, there will be a prompt asking the user to open the SDK studio. The Studio is a web GUI that helps users make look & feel improvements to their SDKs. It uses OpenAPI Overlays to preserve the original OpenAPI specification while allowing users to make changes to the generated SDK.

Saved changes in the Studio automatically triggers a regeneration of the SDK locally.

app.speakeasy.com
Screenshot of the Speakeasy Studio.

It is also possible to make changes without the Studio. Check out the following guide on customizing SDKs for all the details.

Next Step: Uploading the SDK to GitHub

Once the SDK is ready, upload it to GitHub by following the Github setup guide

Last updated on