Supported SDK generators
Mintlify integrates with leading SDK generation platforms:Speakeasy
Automated SDK generation with code samples
Stainless
Type-safe SDK generation from OpenAPI specs
Speakeasy
Integrate autogenerated code snippets from Speakeasy SDKs directly into your API reference documentation. SDK usage snippets appear in the interactive playground of your Mintlify-powered documentation.Prerequisites
- A Mintlify documentation repository
- A Speakeasy-generated SDK with automated code sample URL configured
Setup
Get the combined spec URL
Navigate to your Speakeasy Dashboard and open the API Registry tab.Find and open the entry ending with Copy the public URL from the registry entry page.
-with-code-samples for your API.If you don’t see a “Combined Spec” entry, ensure your API has an automatic code sample URL configured.
Add to docs.json
Add the combined spec URL to your For tabs:
docs.json file in either an anchor or tab configuration.For anchors:docs.json
docs.json
How it works
When you configure Speakeasy:- Speakeasy generates SDKs from your OpenAPI specification
- Code samples are added to a combined OpenAPI spec
- Mintlify reads the combined spec and displays SDK code samples in the playground
- Samples automatically update when you regenerate your SDKs
Supported languages
Speakeasy can generate SDKs in multiple languages:- TypeScript/JavaScript
- Python
- Go
- Java
- C#
- PHP
- Ruby
- Swift
Stainless
Automate SDK code samples in your API playground using Stainless-generated SDKs. Stainless creates type-safe client libraries from your OpenAPI specification.Prerequisites
- A Stainless account
- An OpenAPI specification for your API
Setup
Configure OpenAPI decoration
In your This tells Stainless to format code samples for Mintlify integration.See the Stainless documentation for more configuration options.
stainless.yml config file, add:stainless.yml
Publish your OpenAPI spec
In your Stainless project:
- Navigate to the Release tab
- Select Setup OpenAPI publishing
- Copy the URL to your publicly accessible OpenAPI spec
Add to docs.json
Add the Stainless OpenAPI spec URL to your See OpenAPI Setup for more configuration options.
docs.json file:docs.json
How it works
- Stainless reads your OpenAPI specification
- Generates type-safe SDKs in your target languages
- Adds code samples to your OpenAPI spec in Mintlify format
- Mintlify renders the code samples in your API playground
Supported languages
Stainless generates SDKs in:- TypeScript/JavaScript
- Python
- Go
- Kotlin
Benefits of SDK integrations
Automatic updates
Code samples update automatically when you regenerate SDKs
Type safety
Generated SDKs are fully typed for better developer experience
Multiple languages
Support developers across different programming languages
Reduced maintenance
No manual code sample updates needed
Code sample display
When SDK integrations are configured, your API playground displays:- Language selector tabs for each generated SDK
- Installation instructions for each SDK
- Example code for each API endpoint
- Request/response examples
- Authentication setup code
- Switch between programming languages
- Copy code samples with one click
- See real parameter values in examples
- Test API calls directly in the playground
Comparison
| Feature | Speakeasy | Stainless |
|---|---|---|
| Setup complexity | Medium | Low |
| Language support | 8+ languages | 4 languages |
| Code sample format | Combined spec | Decorated spec |
| Auto-updates | ✓ | ✓ |
| Type safety | ✓ | ✓ |
| Custom templates | ✓ | ✓ |
Best practices
Keep OpenAPI specs in sync
Keep OpenAPI specs in sync
- Update your OpenAPI spec whenever your API changes
- Regenerate SDKs after spec updates
- Use CI/CD to automate spec publishing
Choose relevant languages
Choose relevant languages
- Generate SDKs for languages your users actually use
- Start with 2-3 popular languages
- Add more languages based on user demand
Test code samples
Test code samples
- Verify code samples work before publishing
- Test authentication flows in samples
- Ensure examples use realistic data
Version your SDKs
Version your SDKs
- Maintain SDK versions alongside API versions
- Document breaking changes in SDK releases
- Provide migration guides for major versions
Troubleshooting
Code samples not appearing
Code samples not appearing
- Verify the OpenAPI spec URL is publicly accessible
- Check that the spec includes code sample extensions
- Ensure your
docs.jsonhas the correctopenapifield - Clear your browser cache and reload
Outdated code samples
Outdated code samples
- Regenerate your SDKs in the provider dashboard
- Republish your OpenAPI spec
- Wait a few minutes for CDN cache to clear
Missing languages
Missing languages
- Verify the languages are configured in your SDK generator
- Check that code samples exist for those languages in the spec
- Regenerate SDKs if languages were recently added
Next steps
OpenAPI Setup
Learn more about configuring OpenAPI specs
API Playground
Explore API playground features
Speakeasy Docs
Read Speakeasy documentation
Stainless Docs
Read Stainless documentation