Getting Started
You give us your OpenAPI v3 spec, we give you client SDKs in the most popular languages:
If you want to see our SDKs for yourself, check out this repo of over 4500+ SDKs we generated.
Getting Started
Install
In your terminal, run:
brew install speakeasy-api/homebrew-tap/speakeasy
Authenticate
To use the Speakeasy CLI, you need to authenticate with the Speakeasy Platform.
To do this, run:
speakeasy auth login
This will open a browser window where you can login to the Speakeasy Platform and create or select a workspace (if you have previously used the Platform) by following the prompts. Once logged in you will be redirected to your workspace and an API key will be generated for you. You can then return to the terminal and you should see a message that you are authenticated.
Run
Once installed, get your OpenAPI spec and generate an SDK with a single command:
speakeasy generate sdk -s openapi.yaml -o ./sdks/go/ -l go
Getting started is that easy.
For the full set of CLI commands, see the documentation here.
CLI commands
Below are the available flags for the speakeasy generate sdk
command:
-y, --auto-yes auto answer yes to all prompts
-b, --baseurl string base URL for the api (only required if OpenAPI spec doesn't specify root server URLs
-d, --debug enable writing debug files with broken code
-h, --help help for sdk
-l, --lang string language to generate sdk for (available options: [go, python, typescript, java]) (default "go")
-o, --out string path to the output directory
-s, --schema string path to the openapi schema
Feature Documentation
- SDK Customization - Learn how to configure the SDK generator to your needs.
- Readme Generation - Learn how the SDK generates README.md files and how to control this.
- Generated Comments - Learn how comments are generated from your OpenAPI document and how to customize them.
- Overriding Generated Names - Learn how to override the names of generated methods, parameters, and classes all from your OpenAPI schema.
- Configuring the SDK with Server URLs - Learn how to configure the SDK to use different server URLs for different environments.
- Using custom HTTPs Clients with the SDK - Learn how to provide a custom HTTP Client to the SDKs at runtime.
- Advanced Features
- Capturing Telemetry on SDK Usage - Learn how you can capture telemetry to get an understanding of how your SDKs are being used.
- Automated SDK Generation - Use our Github Action and Workflows to setup CI/CD for generating and publishing your SDKs.
CI/CD
To use the CLI in a CI/CD pipeline, you can authenticate it by creating an API key in the Speakeasy Platform and then setting the SPEAKEASY_API_KEY
environment variable to the value of the API key in your pipeline.