Mintlify
Mintlify is a documentation platform that allows you to create beautiful AI-native documentation sites with minimal effort.
With the Stainless <> Mintlify integration, you can:
- Generate robust and polished SDKs directly from your OpenAPI spec.
- Inject code samples into API docs, providing developers with language-specific implementation examples.
- Keep docs and SDKs automatically in sync as your API evolves.
This integration bridges the gap between documentation and implementation, giving developers copy-paste-ready examples that demonstrate your API in action.
Prerequisites
Before starting, make sure you have:
1. Create Your SDKs in the Studio
- Log in to the Stainless dashboard
- Click "New Project" and upload your OpenAPI specification
- Stainless will analyze your API and create an initial SDK configuration
The SDK Studio provides an immediate preview of your SDK structure based on your API's resources, methods, and models.
When first created, Stainless organizes your API into logical resources, but the exact names and hierarchy is up to you, allowing you to create the most intuitive experience for your users.
The Studio lets you customize everything from resource naming to authentication schemes - dive into the configuration guide to learn how to prepare SDKs developers will love.
2. Generate Code Examples
In the Studio, add the following to your Stainless configuration file:
openapi:
code_samples: 'mintlify'
This tells Stainless to create a copy of your OpenAPI file extended with SDK code examples, in a format Mintlify can render. For advanced integration options and support for other documentation platforms, explore the documentation integration guide.
3. Publish the URL to your OpenAPI spec
Go to your Stainless project page, select the "Release" tab, and select "Setup OpenAPI publishing."
Turn the OpenAPI publishing toggle on. This will create a stable publicly accessible URL for your OpenAPI spec which can be used by Mintlify. This OpenAPI spec is enriched with Stainless SDK code samples in the x-code-samples
field.
The URL is stable and will always stay up-to-date with the latest information about your SDKs.
Finally, click the "copy" button next to the URL.
4. Provide your OpenAPI URL to Mintlify
Now that you have a URL pointing to your documented OpenAPI, the last step is to add it to your Mintlify project's docs.json
file in the openapi
field. See Mintlify's documentation for more information about their OpenAPI integration.
Your docs.json
file will contain something like:
{
"navigation": {
"tabs": [
{
"tab": "API Reference",
"openapi": "https://app.stainless.com/api/spec/documented/<project>/openapi.documented.yml"
}
]
}
}
By combining Stainless's SDK generation with Mintlify's documentation capabilities, you're providing developers with a seamless experience from discovery to implementation.