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.
In your terminal, run:
brew install speakeasy-api/homebrew-tap/speakeasy
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.
For authntication, avoid using Safari as your browser. It will block the redirect back to the CLI that is needed to complete the authentication.
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 -y
Getting started is that easy.
For the full set of CLI commands, see the documentation here.
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
- SDK Gen Configuration - Learn how to configure the SDK generator to your needs.
- Generated Comments - Learn how comments are generated from your OpenAPI document and how to customize them.
- Configuring the SDK with Server URLs - Learn how to configure the SDK to use different server URLs for different environments.
- Readme Generation - Learn how the SDK generates README.md files and how to control this.
- Using custom HTTPs Clients with the SDK - Learn how to provide a custom HTTP Client to the SDKs at runtime.
- 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.
- Overriding Generated Names - Learn how to override the names of generated methods, parameters, and classes all from your OpenAPI schema.
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.