Skip to content
// guide

How to use your own AI API key with your chatbot

Connect your own OpenAI, Anthropic Claude, Google Gemini or xAI Grok API key to your chatbot for unlimited messages on any plan, including Free. Step by step.

  • Updated
  • 4 min read
  • own ai api key
On this page
  1. Why use your own AI key?
  2. Step 1: How do you get an API key from a provider?
  3. Step 2: How do you add the key to InstantKnowledgeBot?
  4. Step 3: How do you switch a bot to your key?
  5. Which model should you choose?
  6. How do hosted messages and your key work together?
  7. What does it cost to run a bot on your own key?
  8. Is it secure to give a chatbot builder your API key?
  9. Can you switch back to hosted AI later?
  10. What else should you know?
  11. FAQ

Connecting your own AI API key lets your chatbot run on your own account with OpenAI, Anthropic, Google or xAI, with no message cap from InstantKnowledgeBot. You pay the provider directly at their rates, and you choose the model per bot. It's available on every plan, including Free, and takes about five minutes to set up.

Why use your own AI key?

  • Unlimited messages on our side. Hosted AI is limited by your plan's monthly allowance; messages on your key aren't capped by us.
  • No markup. Your provider bills you directly.
  • Model choice. Pick a specific model, for example a faster, cheaper one for a simple FAQ bot, or a more capable one for complex documentation.
  • A safety net. If your hosted messages run out, bots switch to your key automatically, so they don't go quiet.
  • Your provider relationship. AI requests on your key run under your account and your agreement with that provider.

New to the idea? Read bring your own key (BYOK) explained.

Step 1: How do you get an API key from a provider?

Create an account with the provider, set up billing (most providers require a payment method or prepaid credit for API use), and create a key in their developer console:

ProviderModelsWhere to create a key
AnthropicClaudeAnthropic Console (console.anthropic.com)
OpenAIChatGPT (GPT) modelsOpenAI Platform (platform.openai.com)
GoogleGeminiGoogle AI Studio (aistudio.google.com)
xAIGrokxAI Console (console.x.ai)

The dashboard's AI providers page links to each provider's key page with Get a key ↗. Copy the key when it's shown; most providers only display it once.

Tip: set a monthly spending limit in your provider's console. It's the simplest way to control costs.

Step 2: How do you add the key to InstantKnowledgeBot?

  1. Log in to the dashboard and open the account menu.
  2. Go to AI providers.
  3. Find your provider and paste the key.
  4. Save. The key is checked with the provider, and the models available to it are listed.
  5. Optionally choose a default model for that provider.

Once saved, the key is encrypted at rest (AES-256-GCM), never shown again, never logged, and only sent to the matching provider. The dashboard shows the last four characters, the status and when it was last checked. You can Test, Replace key or Remove it at any time.

Step 3: How do you switch a bot to your key?

  1. Open the bot and go to its AI engine tab.
  2. Choose Your own key (marked "No cap") instead of Hosted Claude ("Included").
  3. Pick the provider and model.
  4. Click Save engine.

Switching takes effect on the next message. Repeat for each bot that should use your key. Bots can use different providers.

You can also pick the AI engine when creating a new bot: the last step of the New bot flow is AI engine.

Which model should you choose?

There's no single best model. Practical guidance:

  • Simple FAQ bots with short documents: a fast, low-cost model from any provider usually answers well, because the hard part (finding the right text) is handled before the model sees the question.
  • Long technical documentation or nuanced policies: a more capable model may follow instructions and combine sources better.
  • Test, don't guess. Ask the same ten questions on two models in the Test tab and compare accuracy, tone and speed.

Check each provider's pricing page for current per-token rates; they change often.

How do hosted messages and your key work together?

SituationWhat the bot uses
Bot set to Hosted Claude, allowance leftHosted AI (counts toward your monthly allowance)
Bot set to Hosted Claude, allowance used upMessage packs or bonus messages first, then your key automatically if connected
Bot set to Your own keyYour key, with no cap from us
No allowance, no packs, no keyVisitors see a short "temporarily unavailable" note, and we email you

Allowances reset on the 1st of each month (UTC). See the pricing page for plan allowances.

What does it cost to run a bot on your own key?

You pay your provider per token (roughly, per word read and written). A chatbot sends your relevant document text plus the question with each message, so costs depend on your documents' size, the model and how many people chat. Your InstantKnowledgeBot plan price stays the same. For a broader comparison of chatbot pricing approaches, read AI chatbot pricing models.

Is it secure to give a chatbot builder your API key?

It's a reasonable question to ask any vendor. With InstantKnowledgeBot, keys are encrypted at rest, never returned to any browser after saving, never logged, and used only for requests to the matching provider. You can remove a key at any time, and it's good practice to create a dedicated key just for your chatbot, so you can revoke it in your provider's console without affecting other apps. More in AI chatbot privacy and security.

Can you switch back to hosted AI later?

Yes. Open the bot's AI engine tab, choose Hosted Claude and click Save engine. The change applies from the next message. Your key stays saved in AI providers until you remove it, so other bots can keep using it, and it still acts as the automatic fallback when hosted messages run out.

What else should you know?

The account owner manages AI providers. If the AI providers page says bring-your-own-key is turned off, contact support. Ready to try it? Sign up free, build a bot from your PDFs, and connect your key.

Frequently asked questions

Which AI providers can I connect?

Anthropic (Claude), OpenAI (ChatGPT models), Google (Gemini) and xAI (Grok). After you add a key, the models available to it appear for you to choose from.

Is bring-your-own-key available on the free plan?

Yes. Every plan, including Free, can use your own key, and messages on it are unlimited on our side.

Does InstantKnowledgeBot mark up my AI usage?

No. Requests on your key are billed by your provider directly at their rates. We don't add a markup.

How is my API key stored?

It's encrypted at rest with AES-256-GCM, never shown again after you save it, never logged, and only sent to the matching provider. Only the last four characters are displayed.

What happens if my key stops working?

The dashboard shows when a key isn't working, and you can test it. Bots set to use hosted AI keep working; check your provider account for billing or quota issues.

Can different bots use different providers?

Yes. The AI engine is chosen per bot, so one bot can run on Claude and another on Gemini.

Turn your docs into an AI chatbot today.

Free plan forever, no card needed. Upload your files and get a bot that answers from them in under a minute.

Last updated: · InstantKnowledgeBot