Skip to main content
speak-mintlify uses environment variables for sensitive configuration like API keys and S3 credentials. This keeps secrets out of your config files and git history.

Setup

Create a .env file in your documentation directory:
Add .env to your .gitignore to prevent committing secrets to version control.

Required Variables

Fish Audio API Key

.env
Required for: TTS audio generation Get your key: Sign up at Fish Audio and generate an API key from your dashboard.
The Fish API key is only required when running the generate command. The cleanup command doesn’t need it.

S3 Configuration

speak-mintlify uploads generated audio files to S3-compatible storage (AWS S3, Cloudflare R2, MinIO, etc.).
.env
Required variables:
  • S3_ACCESS_KEY_ID - S3 access key for authentication
  • S3_SECRET_ACCESS_KEY - S3 secret key for authentication
  • S3_BUCKET - Name of your S3 bucket
  • S3_PUBLIC_URL - Public CDN URL for accessing uploaded files
  • S3_REGION - AWS region (default: us-east-1)

Custom S3 Endpoint (Optional)

For S3-compatible services like Cloudflare R2 or MinIO:
.env
Use cases:
  • Cloudflare R2
  • MinIO
  • DigitalOcean Spaces
  • Any S3-compatible storage

Complete Example

.env

CLI Overrides

All environment variables can be overridden with CLI flags:
Use CLI flags for temporary overrides or CI/CD environments. Use .env for local development.

Configuration Priority

speak-mintlify resolves configuration in this order:
  1. CLI flags (highest priority)
  2. Environment variables
  3. speaker-config.yaml
  4. Defaults (lowest priority)

Advanced Options

S3 Path Prefix

Customize where audio files are stored in your S3 bucket:
This creates paths like: s3://your-bucket/tts/filename.mp3

Validation

speak-mintlify validates required configuration on startup. If any required variables are missing, you’ll see:

Security Best Practices

1

Use .gitignore

Always add .env to your .gitignore file
2

Rotate keys regularly

Periodically rotate your API keys and S3 credentials
3

Use IAM policies

Limit S3 credentials to only the permissions needed (PutObject, GetObject, DeleteObject)
4

Use environment-specific configs

Keep separate .env.production and .env.staging files

Next Steps

Speaker Config

Configure voices and components

Getting Started

Start generating audio