Skip to main content
If your users interact with your API through an SDK rather than direct network requests, add SDK code samples with the x-codeSamples extension. Mintlify displays these samples on your OpenAPI pages. Add this property to any request method. It has the following schema.
string
required
The language of the code sample.
string
The label for the sample. This is useful when providing multiple examples for a single endpoint.
string
required
The source code of the sample.
The following example shows code samples for a plant tracking app that has both a Bash CLI tool and a JavaScript SDK.