Getting started
Providers and API keys
Use your own Claude, DeepL, Gemini, Google Translate or OpenAI API key on a paid plan. Your provider bills you directly.
You bring the key
This article covers using your own API key on a paid plan. Requests go straight from your server to your provider, which bills you directly. With this option, your content does not pass through wpglotty.com. For translation without a separate key, see WPGlotty credits. These use our own translation engine and charge your account in words.
WPGlotty suggests Claude first, and its model settings start on Claude. Gemini and OpenAI also support tone instructions. DeepL and Google Translate offer lower-cost translation, but do not use your translation style, tone or site profile.
- Claude, from Anthropic: the suggested choice, with support for tone of voice
- DeepL: lower-cost translation, without tone instructions
- Google Translate: the widest language coverage, and the cheapest per character
- OpenAI: an option if you already have API credit with OpenAI
DeepL and Google Translate translate existing text but cannot write new text, such as a missing search description. If either is your only provider, the editor hides buttons for writing new text. Connect one alongside Claude, Gemini or OpenAI to use both. The model writes new text, while the lower-cost engine translates existing text.
Two models for different tasks
Model handles one string sent alone, such as a sentence you redo in the editor. Bulk model handles every request with more than one string, which covers nearly all translation. This includes whole-site runs, pages a visitor waits for and pages you translate from the editor. Choose a cheaper model for bulk.
The defaults are Claude Opus for single strings and Claude Sonnet for bulk translation. At current prices, Sonnet costs two-fifths as much per token.
Set a monthly spending limit
Under Settings, you can set a monthly budget in dollars. WPGlotty warns you at 80% by default; adjust this under Warn at. At 100%, it stops sending new work to your provider. Existing translations remain available.
The limit is off by default, so it will not interrupt translation during a launch. Set it once you know your usual monthly translation costs.
The limit only counts spending through WPGlotty. It cannot track other uses of the same API key. If you use the key elsewhere, your provider’s bill will be higher.
A second provider as a fallback
In the Keys list, set another provider to Fallback and choose its Fallback model and Fallback bulk model. It handles requests blocked by your main provider’s rate limit, outage or content filter.
Set a fallback even if your main provider is reliable. It helps prevent visitors seeing untranslated text when your main provider fails.
Stay within your provider’s limits
Batch size, Calls at a time, requests per minute and tokens per minute keep WPGlotty within your provider’s limits. The defaults suit a new account. Raise them once you know its limits. On WPGlotty credits, these settings are hidden and managed for you.
Pages read at a time controls the load on your server during whole-site runs. While a visitor waits has separate settings, including OpenAI priority processing.
Advanced: keeping keys out of the database
WPGlotty encrypts saved keys if your server has PHP’s sodium extension. Otherwise, it stores them encoded, and the settings screen warns you. To keep keys out of the database, define them in wp-config.php instead. A constant overrides the saved setting, and the settings field shows this.
For encryption, WPGlotty uses a separate key if you provide one. Otherwise, it uses your site’s WordPress salts. Changing your salts is recommended after a security incident. A separate key keeps your stored provider keys readable when you do this. Without it, changing the salts makes those keys unreadable. The settings screen generates an encryption key constant for wp-config.php. Add it before entering provider keys. If you add it later, enter those keys again.
define( 'WPGLOTTY_ANTHROPIC_API_KEY', 'sk-ant-…' );
define( 'WPGLOTTY_DEEPL_API_KEY', '…' );
define( 'WPGLOTTY_GEMINI_API_KEY', '…' );
define( 'WPGLOTTY_GOOGLE_API_KEY', '…' );
define( 'WPGLOTTY_OPENAI_API_KEY', '…' );
// Optional: a key of its own for encrypting stored provider keys.
define( 'WPGLOTTY_ENCRYPTION_KEY', '…' );