SaleSave up to 20% on Pro with code SALE20See pricing →

API Key Configuration

Reading Time: 3 minutes
Download Markdown

Overview

WPiko AI Chatbot runs on your own OpenAI account. You pay OpenAI directly for what you use (usually a few dollars a month for a small site), and there’s no WPiko subscription. To connect, you need an OpenAI API key and prepaid credit on that account.

Tip: the Setup Wizard walks you through these same steps after you activate the plugin.

Step 1–3: Get an OpenAI API Key

  1. Sign in to the OpenAI Platform at platform.openai.com. This is separate from ChatGPT: a ChatGPT Plus plan does not include API usage.
  2. Add credit to your account in OpenAI’s billing settings. The API is prepaid. Without credit, the key is accepted but every answer fails. $5 is enough to start.
  3. Create a secret key in the API keys section. Keys start with sk-. OpenAI shows the key only once, so copy it straight away.

Save and Test the Key

  1. Go to WPiko AI Chatbot → AI & Training → AI Settings and open the API Connection tab.
  2. In OpenAI connection, paste your key into OpenAI API Key.
  3. Click Save and Test API Key.

When you save, WPiko sends one tiny test message to OpenAI (it costs a fraction of a cent). This confirms both that the key is valid and that your account has credit, so problems show up now instead of when a visitor chats.

After the first successful connection, the floating chatbot is switched on automatically across your site. You can change where it appears in Chat Widget → Placement → Floating Chatbot.

Until an API key is added, the chatbot is shown only to site admins, never to visitors.

Connection Status

The Connection status card on the API Connection tab shows the current state. The same tab also has a short Get your API key guide with links to the OpenAI pages you need.

  • Connected to OpenAI: the last test worked (with how long ago it was checked).
  • Connection not tested yet: run a test to confirm the key and credit.
  • The chatbot cannot answer visitors: shows the exact reason, such as no credit or a rejected key, with a link to fix it in OpenAI.

Click Test connection at any time, for example after adding credit in OpenAI. New credit can take a few minutes to become active.

Security

  • The key is encrypted before it’s stored in the database.
  • Only the last 5 characters are shown after saving.
  • The key is never sent to visitors’ browsers.

More details: API Key Security.

Changing or Deleting the Key

  • To change it: click Delete API Key, paste the new key and click Save and Test API Key.
  • To remove it: click Delete API Key and confirm. The chatbot stops answering visitors until a new key is saved.

Troubleshooting

  • “That does not look like an OpenAI secret key”: copy the full key that starts with sk-.
  • “Your OpenAI account has no credit”: the key works, but you need to add prepaid credit in OpenAI billing, then click Test connection.
  • “OpenAI rejected the API key”: the key was mistyped, deleted or revoked, or its project was archived. Create a new key.
  • “Your server could not connect to api.openai.com”: ask your host to allow outgoing HTTPS connections to api.openai.com.

For every message and its fix, see Troubleshooting the OpenAI Connection.

Have a Question?