Deploy with Fly.io
Deploy Helicone AI Gateway to Fly.io in 5 minutes
Deploy the AI Gateway to Fly.io for a simple, scalable cloud deployment with automatic scaling and global distribution.
Security Notice: Fly.io deployments are publicly accessible. You must enable authentication to prevent unauthorized access to your provider API keys. This guide includes authentication setup as a required step.
Quick Start
Install Fly CLI
Install the Fly.io CLI tool:
If you encounter any issues with installation, refer to the official Fly.io installation guide.
Get your Helicone API key
The AI Gateway configuration has authentication enabled by default to secure your public deployment. You’ll need a Helicone API key to authenticate requests.
Create your Helicone API key:
- Go to Helicone Settings
- Click “Generate New Key”
- Copy the key (starts with
sk-helicone-
) - Save it securely - you’ll need it for deployment
Get the fly.toml configuration
Download the official fly.toml configuration from our GitHub repository:
This configuration file contains all the necessary settings for deploying the AI Gateway to Fly.io.
Launch and deploy
Launch your app with Fly.io:
This command will:
- Automatically prompt you to log in if needed
- Create the app with a unique name
- Set up your deployment
- Deploy your AI Gateway
The deployment will complete, but you’ll need to add your API keys next.
Configure authentication & API keys
Enable authentication to secure your public deployment, then add your provider API keys:
Use the Helicone API key you created in step 2. This enables secure authentication for your gateway.
Redeploy with secrets
After adding your environment variables, redeploy to apply them:
Your AI Gateway is now fully configured and ready to use!
Test Your Deployment
Once deployed, test your AI Gateway with authentication:
Replace sk-helicone-your-api-key
with your actual Helicone API key for secure access to your gateway.
Using a Configuration File
The default fly.toml includes a basic router configuration, but you can customize it for your specific needs.
Create a custom config file
Create a config.yaml
file in your project directory:
Update fly.toml
Modify the [[files]]
section in your fly.toml
to use your local config file:
Replace the existing raw_value
line with local_path
pointing to your config file.
Redeploy
Deploy to apply your changes:
For advanced routing options, learn about routers.