# Using curl
curl -fsSL https://go.speakeasy.com/cli-install.sh | sh
```

#### Linting your OpenAPI document

Before generating SDKs, lint your OpenAPI document to catch common issues:

```bash filename="Terminal"
speakeasy lint openapi --schema openapi.yaml
```

#### Using AI to improve your OpenAPI document

The Speakeasy CLI now includes AI-powered suggestions to automatically improve your OpenAPI documents:

```bash filename="Terminal"
speakeasy suggest openapi.yaml
```

Follow the onscreen prompts to provide the necessary configuration details for your new SDK, such as the schema and output path.

Read the [Speakeasy Suggest](/docs/prep-openapi/maintenance) documentation for more information on how to use Speakeasy Suggest.

#### Generating your SDK

Now you can generate your SDK using the quickstart command:

```bash filename="Terminal"
speakeasy quickstart
```

Follow the onscreen prompts to provide the necessary configuration details for your new SDK, such as the name, schema location, and output path. Enter `openapi.yaml` (or your improved OpenAPI document if you used suggestions) when prompted for the OpenAPI document location, and select your preferred language when prompted.

## Using your generated SDK

Once you've generated your SDK, you can [publish](/docs/publish-sdk) it for use. For TypeScript, you can publish it as an npm package.

TypeScript SDKs generated with Speakeasy include an installable [Model Context Protocol (MCP) server](/docs/standalone-mcp/build-server) where the various SDK methods are exposed as tools that AI applications can invoke. Your SDK documentation includes instructions for installing the MCP server.

<Callout title="Production Readiness" type="warning">
  Note that the SDK is not ready for production use immediately after
  generation. To get it production-ready, follow the steps outlined in your
  Speakeasy workspace.
</Callout>

### Adding SDK generation to your CI/CD pipeline

The Speakeasy [`sdk-generation-action`](https://github.com/speakeasy-api/sdk-generation-action) repository provides workflows for integrating the Speakeasy CLI into CI/CD pipelines to automatically regenerate SDKs when your Zod schemas change.

You can set up Speakeasy to automatically push a new branch to your SDK repositories so that your engineers can review and merge the SDK changes.

For an overview of how to set up automation for your SDKs, see the Speakeasy [SDK workflow syntax reference](/docs/speakeasy-reference/workflow-file).

## Summary

In this tutorial, we learned how to generate OpenAPI schemas from Zod and create client SDKs with Speakeasy.

By following these steps, you can ensure that your API is well-documented, easy to use, and offers a great developer experience.

### Further reading

This guide covered the basics of generating an OpenAPI document using `zod-openapi`. Here are some resources to help you learn more about Zod, OpenAPI, and Speakeasy:

- [The `zod-openapi` documentation](https://github.com/samchungy/zod-openapi): Learn more about the `zod-openapi` library, including advanced features like custom serializers and middleware integration.
- [The Zod documentation](https://zod.dev/): Comprehensive guide to Zod schema validation, including the latest v4 features.