Raycast Integration
Raycast is a productivity tool for macOS with powerful AI features. Using Raycast’s Bring Your Own Key (BYOK) feature, you can route AI requests through the LeanMCP AI Gateway.Raycast BYOK lets you use your own API keys from AI providers. By pointing to the LeanMCP AI Gateway, you get full visibility into your AI usage.
Prerequisites
Get Credits
Purchase credits at ship.leanmcp.com
Create API Key
Create an API key at ship.leanmcp.com/api-keys with SDK permissions
Install Raycast
Download and install Raycast if you haven’t already
Understanding Raycast BYOK
Raycast’s Bring Your Own Key feature allows you to:- Use AI models without a Raycast Pro subscription
- Pay only for what you use via your own API keys
- Use Raycast AI with any OpenAI-compatible endpoint
With BYOK, you can send as many AI messages as you want at your own cost, without needing a Pro subscription.
Configuration
Open Raycast AI Settings
- Open Raycast (default:
Cmd + Space) - Type “Raycast Settings” and press Enter
- Navigate to the AI section

Add OpenAI-Compatible Key
For OpenAI models via LeanMCP:Provider: OpenAI (or OpenRouter for all providers)API Key:
Using OpenRouter for Full Gateway Support
For complete LeanMCP AI Gateway integration with Raycast, use OpenRouter as the provider:Enter LeanMCP API Key
Enter your LeanMCP API key in the OpenRouter API key field.
The LeanMCP AI Gateway is OpenRouter-compatible, so Raycast will route requests through the gateway.
What Raycast Sends to AI
When you use Raycast AI, the following may be sent:- Your prompt/question
- Selected text (if using “Ask AI about selection”)
- Clipboard contents (if using clipboard features)
- File contents (if using file-based commands)
Model Selection
After configuring BYOK, you’ll see a key icon next to models using your API key:
- OpenAI: GPT-5.2, GPT-5.2, GPT-5.2
- Anthropic: Claude Sonnet 4.5, Claude Opus 4.5
- OpenRouter: Access to 100+ models
Privacy Considerations
When using BYOK (excluding OpenRouter), Raycast processes requests through their servers to unify APIs and add features. With the LeanMCP gateway, you get an additional layer of logging and control.
Local Models Alternative
If you want complete privacy, Raycast also supports local models via Ollama:- Install Ollama
- Pull a model:
ollama pull llama2 - Select the local model in Raycast
Local models run entirely on your machine and don’t go through any external service.
Benefits of Using AI Gateway with Raycast
Usage Tracking
See exactly how much you’re using Raycast AI
Cost Monitoring
Track spending across all your Raycast AI usage
Sensitive Data Alerts
Get notified if clipboard or selection contains secrets
Request History
Review past AI interactions and their costs
Troubleshooting
API key validation fails
API key validation fails
- Ensure your LeanMCP API key has credits
- Check the key has SDK permissions
- Verify you’re using the correct provider setting
Models not appearing
Models not appearing
- Restart Raycast after adding the API key
- Check Raycast has the latest version
- Try removing and re-adding the API key
Requests not in LeanMCP dashboard
Requests not in LeanMCP dashboard
- Confirm you’re using the LeanMCP API key
- Some requests may go directly to providers depending on Raycast’s routing
- Try using OpenRouter mode for guaranteed gateway routing