> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify-docs-simplify-quickstart-2510244c.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Stainless

> Automate your SDK example snippets in the API playground

To integrate Stainless with your Mintlify OpenAPI documentation:

1. Add to your Stainless config:

```yaml openapi.stainless.yml
openapi:
  code_samples: mintlify
```

2. [Configure OpenAPI](/api-playground/openapi/setup#in-the-repo) in your Mintlify docs.

3. Add this GitHub Action to sync your OpenAPI spec:

```yaml
name: Sync OpenAPI Spec

on:
  push:
    branches: [main]
  workflow_dispatch:

jobs:
  stainless:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Push to Stainless
        uses: stainless-api/upload-openapi-spec-action@main
        with:
          input_path: 'path/to/my-company-openapi.json'
          config_path: 'path/to/my-company.stainless.yaml'
          output_path: 'path/to/my-company-openapi.documented.json'
          project_name: 'my-stainless-project'
      - name: Push to docs repo
        uses: dmnemec/copy_file_to_another_repo_action@main
        env:
          API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
        with:
          source_file: 'config/my-company-openapi.documented.json'
          destination_repo: '{DOCS_REPO_NAME}'
          destination_folder: 'openapi-specs'
          user_email: '{EMAIL}'
          user_name: '{USERNAME}'
          commit_message: 'Auto-updates from Stainless'
```

Required GitHub Secrets:

* `STAINLESS_API_KEY`: Your Stainless API key
* `API_TOKEN_GITHUB`: GitHub [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) with repo access
