Bring your own API key
Create a key for your WordPress site, cap the spend and check the connection. Start with the walkthrough or go straight to your provider.
BYOK setup walkthrough
Walkthrough chapters
Select a provider and model for the site.
Google AI Studio
gemini-2.5-flash-lite- Open API Keys in AI Studio. Choose a Google Cloud project dedicated to this site, or create one. Create the key in that project.
- Select Google Gemini in WordPress and enter the key for gemini-2.5-flash-lite. The preset sends it in the x-goog-api-key header.
- Check the project’s model limits before using free quota. For a paid project, open Spend → Monthly spend cap → Edit spend cap. Save the amount and set a daily limit in LeadShield to cover billing delays.
- For API clients offered to users in the EEA, Switzerland or the UK, use Paid Services under Google’s terms. With paid services, Google does not use prompts or responses to improve its products.
DeepSeek Platform
deepseek-flash- Open the DeepSeek API platform and create a site-specific key under API Keys. Store it in the site’s provider settings.
- In Top up, fund a small prepaid balance. Choose Alipay or WeChat Pay when offered by your billing account. Check the amount and currency before confirming.
- Choose DeepSeek and deepseek-flash in WordPress. Use the Flash preset for new setups and test existing legacy aliases before reuse.
- Limit exposure with the prepaid balance and a daily AI request and cost cap in LeadShield. Review usage in the platform dashboard. An exhausted balance returns 402 and triggers flagged delivery.
Alibaba Cloud Model Studio
qwen-turbo- Choose Beijing (CN) or Singapore (Intl) in Model Studio before creating an API key. Select the workspace for this site and check model access for qwen-turbo.
- Select the same region in the WordPress Qwen preset. Use that region’s key and endpoint together. Changing regions clears the saved binding and requires a new key.
- Open Cost and Usage → Budget Management. Choose this workspace or key. On a CNY account, set a ¥10 monthly budget with a notification at 100%. In the international console enter the amount in its displayed billing currency.
- For enforced limits, enable Stop Service When Budget Reached where available. Add the daily site cap and run a connection test for this region.
Beijing · China
https://dashscope.aliyuncs.com/compatible-mode/v1Use a key issued in this region.Singapore · International
https://dashscope-intl.aliyuncs.com/compatible-mode/v1Use a key issued in this region.OpenAI Platform
gpt-5-nano- In organization settings, create or select a project for this site. Open the project’s API Keys and create a secret key. Give it the access needed for Chat Completions.
- Go to the project’s Limits. Allow gpt-5-nano under Model usage and set the monthly spend limit. Add an alert recipient and a threshold below the budget.
- Turn on Enforce a hard limit if available, then save. A spend alert alone sends a notification. Metering can lag, so also set a conservative daily allowance in LeadShield.
- Select OpenAI in WordPress, bind the project key and run the test. The preset uses minimal reasoning effort and 300 max_completion_tokens for room to return a verdict.
Error codes and region troubleshooting
For each case below the buyer gets a flagged inbox delivery. Google Ads stays blocked until the inquiry is verified.
| Test result | What to check |
|---|---|
| 401 · Invalid key | Confirm the selected project and region. Replace the rejected key for the same approved origin, then rerun the synthetic test. |
| 402 · Quota exhausted | Check prepaid balance and the billing account. Restore credit or revise the intended limit before testing again. |
| 429 · Rate or quota limit | Read the provider’s limit in its usage panel. Reduce requests or adjust the permitted budget, then retry the test after the reset. |
| Region mismatch | Check the issuing region, workspace and hostname together. Select the matching preset and enter that region’s key again. |
| Timeout fallback | A response taking over four seconds triggers DELIVER_FLAGGED. Check endpoint health and latency with a synthetic request before resuming model checks. |
Install the WordPress plugin
With the release ZIP, go to Plugins → Add New Plugin → Upload Plugin. Install and activate LeadShield AI. Open the provider settings, enter the site’s key and choose Test Connection before starting the seven-day Shadow mode.