Skip to main content

BYOK (Bring Your Own Key)

BYOK lets you connect your own Groq or OpenAI API keys for translations. You pay HephBot's BYOK subscription tier plus your provider usage. This unlocks custom models, prompts, sampling parameters, and protection delimiters.


Who needs BYOK?

TierAPI keyCustom model/prompt
Free / Trial / Server Boost (managed)Bot providesOptimized defaults (Boost) or shared key (Trial)
User BYOK – Groq / OpenAIYour keyYes
Server BYOK – Groq / OpenAIGuild keyYes

→ Premium tier comparison


Engine resolution order

When translating, HephBot picks an engine in this order:

flowchart LR
A[Translation request] --> B{User premium engine?}
B -->|Yes| C[User settings]
B -->|No| D{Guild Pro seat?}
D -->|Yes| E[Managed Groq via seat]
D -->|No| F{Guild engine?}
F -->|Yes| G[Guild settings]
F -->|No| H[Global default / self-hosted]

Personal BYOK settings override server defaults when you have user premium. User Pro seats on a paying guild can give members managed Groq without their own key.


Setting up BYOK

Personal (user settings)

  1. Subscribe to User BYOK – Groq or User BYOK – OpenAI
  2. Open Dashboard → User Settings
  3. Select your engine
  4. Enter and save your API key (encrypted at rest)
  5. Optionally set model, prompt, sampling params, and delimiters

Server (guild settings)

  1. Subscribe to Server BYOK – Groq or Server BYOK – OpenAI
  2. Dashboard → your server → Server Configuration
  3. Set engine to your BYOK provider
  4. Enter guild API key and advanced options

Discord alternative (keys only):

/settings guild set_api_key provider:groq key:YOUR_KEY

Model and prompt fields are managed in the dashboard, not via /settings.

→ Dashboard BYOK reference


Custom prompts

Prompt templates support placeholders:

VariableMeaning
{source_language}Detected or specified source language
{target_language}Target language name
{text}Message text to translate

For Default Language and auto-translate flows, the dashboard appends guidance so the model knows output is posted directly to Discord.


Sampling parameters (API options)

Available when using BYOK engines. Leave blank to use bot defaults.

ParameterRangeEffect
Temperature0 – 2Higher = more creative; lower = more deterministic
Top P0 – 1Nucleus sampling threshold
Max tokens1 – 128,000Upper bound on response length
Frequency penalty−2 – 2Reduces repetition
Presence penalty−2 – 2Encourages new topics
Reasoning effort (OpenAI)low / medium / highFor reasoning-capable models
Starting values

For translation, start with temperature 0.2–0.5 and leave other fields empty. Increase temperature only if translations feel too stiff.


Custom protection delimiters

BYOK translation pipeline — wrap protected content, call LLM, unwrap and post

BYOK translations run through a protection layer before the LLM sees your text. Sensitive Discord syntax is wrapped so the model does not alter it.

Default wrappers: {{{{}}}}

You can customize open/close markers (1–16 characters each, must differ).

Protected content includes:

  • User and role mentions
  • Channel mentions
  • URLs and markdown links
  • Custom emoji
  • Spoilers and code blocks
  • Terms on your translation blacklist
flowchart LR
A[Original message] --> B[Wrap protected segments]
B --> C[LLM translation]
C --> D[Unwrap & restore syntax]
D --> E[Posted translation]

User delimiters apply to personal BYOK translations. Guild delimiters apply when the guild BYOK engine is active.


Security

  • API keys are encrypted before storage
  • Audit logs record key updates but never the key value
  • Use restricted API keys from your provider when possible
  • Rotate keys if a staff member with dashboard access leaves

Troubleshooting

IssueWhat to check
Translations fall back to self-hostedPremium expired, key missing, or invalid key
401 / auth errors in error logsRegenerate API key at provider
Model not foundModel name must match provider's current model list
Mentions broken in outputVerify delimiter settings; avoid markers that appear in normal text
High API costsLower max tokens; use Groq for high-volume servers

→ Full troubleshooting guide


AI profiles

AI profiles let you save reusable BYOK presets (engine, model, prompt, optional API key) and assign them to mirrors, default-language channels, flag reactions, and the Translate context menu. Delimiters and extended sampling parameters still come from the main BYOK settings described above.

→ Full AI profiles guide