Skip to main content
Rrelay»

Providers

AI providers, speech-to-text, and translation setup

Relay has three types of providers: AI model providers (via OpenCode), speech-to-text providers (for voice messages), and translation (for non-English voice input).


AI Providers (via OpenCode)

Relay uses OpenCode as its AI backend. OpenCode supports 75+ AI providers through a single unified interface. The OpenCode SDK is bundled — no extra installation needed.

Supported Providers

ProviderModelsEnvironment Variable
AnthropicClaude Opus, Sonnet, HaikuANTHROPIC_API_KEY
OpenAIGPT-4, GPT-4 Turbo, o1, o3, o4-miniOPENAI_API_KEY
GoogleGemini Pro, Gemini 2.0, Gemini 2.5GOOGLE_API_KEY
DeepSeekDeepSeek V3, DeepSeek R1DEEPSEEK_API_KEY
MistralMistral Large, CodestralMISTRAL_API_KEY
GroqLlama, Mixtral (fast inference)GROQ_API_KEY
Local modelsOllama, LocalAI, LM StudioVaries by runtime

And many more — any provider supported by OpenCode works with Relay. See the OpenCode documentation for the full list.

API Keys

Provider API keys are configured in OpenCode's environment, not in Relay's config. Set them as environment variables before starting Relay:

# Anthropic
export ANTHROPIC_API_KEY="sk-ant-..."

# OpenAI
export OPENAI_API_KEY="sk-..."

# Google
export GOOGLE_API_KEY="..."

# DeepSeek
export DEEPSEEK_API_KEY="..."

Relay spawns and manages the OpenCode server automatically.

"provider": "opencode",
"opencodeMode": "start",
"opencodeHostname": "127.0.0.1",
"opencodePort": 4096

Connect Mode

Connect to an already-running OpenCode server — useful for remote setups or shared servers.

"provider": "opencode",
"opencodeMode": "connect",
"opencodeUrl": "http://localhost:4096"

Model Selection

Set a default model in config:

"opencodeModel": "anthropic/claude-sonnet-4-20250514"

Or change at runtime:

  • /models — interactive inline keyboard with capability badges
  • /model sonnet — text-based partial match
  • /model anthropic/claude-sonnet-4-20250514 — full model path

Models are fetched dynamically from all configured OpenCode providers. Each model shows capability badges: [reasoning] for extended thinking, [vision] for image input, [free] for free-tier models.

Supported Features

All Relay features work with OpenCode: sessions, streaming, file operations, todos, diffs, forking, shell access, MCP management, dynamic model listing, file attachments, revert/unrevert, session sharing, and custom commands.


Speech-to-Text Providers

Voice messages in Telegram are transcribed using one of the following STT providers. Configure at least one API key to enable voice support.

Groq

Fastest option with a free tier. Uses the Whisper model via Groq's inference API.

FieldValue
Config keygroqApiKey
Model configgroqSttModel
Default modelwhisper-large-v3-turbo
Endpointapi.groq.com/openai/v1/audio/transcriptions
"groqApiKey": "gsk_..."

Sarvam AI

Indian-language optimized STT with support for Hindi, Tamil, Telugu, and other Indian languages.

FieldValue
Config keysarvamApiKey
Model configsarvamSttModel
Default modelsaaras:v3
SDKsarvamai (npm package)
"sarvamApiKey": "..."

AssemblyAI

Reliable alternative with good accuracy. Uses a two-step upload-then-transcribe flow.

FieldValue
Config keyassemblyaiApiKey
Endpointapi.assemblyai.com/v2/
"assemblyaiApiKey": "..."

OpenAI

Standard OpenAI Whisper API.

FieldValue
Config keyopenaiSttApiKey
Model configopenaiSttModel
Default modelgpt-4o-mini-transcribe
Endpointapi.openai.com/v1/audio/transcriptions
"openaiSttApiKey": "sk-..."

Auto-selection Priority

When sttProvider is set to auto (the default), the cheapest available provider is selected automatically:

  1. Groq — fastest, free tier available
  2. Sarvam — optimized for Indian languages
  3. AssemblyAI — reliable general-purpose
  4. OpenAI — widely available fallback

Override with a specific provider:

"sttProvider": "groq"

Valid values: auto, groq, sarvam, sarvam-translate, openai, assemblyai.


Translation (Sarvam)

Sarvam AI supports a translate mode that transcribes non-English voice messages and translates them to English in a single step. This is useful if you speak in Hindi or another Indian language but want the AI to receive English text.

Configuration

Use the same sarvamApiKey as Sarvam STT. Set the provider to sarvam-translate:

"sarvamApiKey": "...",
"sttProvider": "sarvam-translate"

How it works

  1. You record a voice message in any supported language (Hindi, Tamil, Telugu, etc.)
  2. Sarvam transcribes the audio and translates it to English
  3. The English text is sent to the AI as a regular message
  4. The AI responds in English as usual

The translate mode uses the same saaras:v3 model as regular Sarvam STT, with mode: "translate" enabled.