1Code includes hold-to-talk voice input powered by OpenAI’s Whisper API for accurate speech-to-text transcription.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/21st-dev/1code/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Voice input allows you to:- Dictate prompts hands-free while coding
- Use voice during code reviews or pair programming
- Input long descriptions without typing
- Work more ergonomically by reducing keyboard use
Voice input requires either a paid 1Code subscription or your own OpenAI API key.
Setup
Option 1: 1Code Subscription (Recommended)
Voice transcription is included with paid plans:- Pro Plan - Includes voice input
- Max Plan - Includes voice input
Option 2: Bring Your Own OpenAI Key
If you’re using the open-source build without a subscription:- Get an OpenAI API key from platform.openai.com/api-keys
- Add it to your environment or settings
Setting via Environment Variable
Add to your shell profile (~/.zshrc or ~/.bashrc):
~/.zshrc
.env.local file with the MAIN_VITE_ prefix:
.env.local
Setting via UI
- Open Settings → Models
- Find “OpenAI API Key” section
- Enter your API key
- Save
Using Voice Input
Basic Usage
- Click the microphone icon in the chat input
- Hold the button while speaking
- Release when finished
- Your speech is transcribed and inserted into the input
Keyboard Shortcut
You can also trigger voice input with a keyboard shortcut (configurable in Settings).Language Support
Voice input supports multiple languages. You can specify the language code when transcribing:en- Englishes- Spanishfr- Frenchde- Germanru- Russianzh- Chinese- And many more (Whisper supports 50+ languages)
How It Works
Architecture
From/home/daytona/workspace/source/src/main/lib/trpc/routers/voice.ts:5-7:
Priority Order
1Code checks for API keys in this priority order:- User-configured key (from Settings) - highest priority
- Vite env vars (
.env.localwithMAIN_VITE_OPENAI_API_KEY) - Process environment (
process.env.OPENAI_API_KEY) - Shell environment (loaded from
~/.zshrcor~/.bashrc)
/home/daytona/workspace/source/src/main/lib/trpc/routers/voice.ts:117-177:
Transcription Process
- Record: Audio is captured in WebM format (browser native)
- Upload: Audio buffer is sent to transcription service
- Transcribe: Whisper API converts speech to text
- Clean: Text is normalized (whitespace, punctuation)
- Insert: Transcribed text is inserted into chat input
/home/daytona/workspace/source/src/main/lib/trpc/routers/voice.ts:29-45:
Audio Limits
- Max file size: 25MB (Whisper API limit)
- Timeout: 30 seconds per request
- Supported formats: WebM, WAV, MP3, M4A, OGG
API Implementation
Check Availability
From/home/daytona/workspace/source/src/main/lib/trpc/routers/voice.ts:397-440:
Transcribe Audio
Cost & Usage
1Code Subscription
Voice transcription is included in your subscription:- No per-usage billing
- Unlimited transcriptions (fair use)
- No need to manage API keys
OpenAI API (BYOK)
If using your own OpenAI key:- Pricing: ~$0.006 per minute of audio (Whisper API)
- Billing: Charged to your OpenAI account
- Limits: Based on your OpenAI account tier
Privacy & Security
Audio Data
- Recording: Captured locally in browser, never stored to disk
- Transmission: Sent directly to OpenAI or 1Code backend over HTTPS
- Storage: Not stored after transcription (immediately discarded)
- Encryption: All requests use TLS encryption
API Keys
When using your own OpenAI key:- Storage: Encrypted using Electron
safeStorage - Transmission: Never sent to 1Code backend
- Access: Only used for direct OpenAI API calls
Troubleshooting
Voice Input Not Available
Check subscription status
Check subscription status
Voice input requires a paid subscription. Check your plan at Settings → Account.
Verify API key
Verify API key
If using BYOK, ensure your OpenAI key:
- Starts with
sk- - Has not expired or been revoked
- Is set in environment or Settings
Restart 1Code
Restart 1Code
After setting environment variables, restart the app to reload configuration.
Transcription Errors
Check microphone permissions
Check microphone permissions
Ensure 1Code has microphone access:
- macOS: System Settings → Privacy & Security → Microphone
- Windows: Settings → Privacy → Microphone
- Linux: Check PulseAudio/ALSA permissions
Test microphone
Test microphone
Verify your microphone works in other apps (Zoom, Discord, etc.)
Check audio format
Check audio format
Try a different audio format if transcription fails. WebM usually works best.
Reduce background noise
Reduce background noise
Whisper performs better with clear audio. Minimize background noise and speak clearly.
API Key Issues
Invalid key format
Invalid key format
OpenAI keys must start with
sk-. Double-check you copied the full key.Rate limiting
Rate limiting
If you hit rate limits, wait a few minutes or upgrade your OpenAI plan.
Insufficient quota
Insufficient quota
Ensure your OpenAI account has available credits. Add payment method at OpenAI.
Environment Variable Not Loading
From/home/daytona/workspace/source/.env.example:35-38:
.env.example
- Use the
MAIN_VITE_prefix for.env.localfiles - Restart 1Code after changing environment
- Check that the file is in the correct location
Tips for Best Results
Use a quality microphone
Better audio quality = better transcription accuracy
Speak clearly and naturally
Whisper is trained on natural speech, not robotic dictation
Minimize background noise
Use a quiet environment or noise-canceling microphone
Specify language if needed
For non-English input, set the language for better accuracy
Related Resources
Custom Models
Configure API keys and custom providers
Configuration
Learn about advanced configuration options