Skip to content
The AI assistant block

How to get an AI API key and connect it in Forgebot

The AI-assistant block replies to customers using your company's own key — you pay the provider directly, and there are no Forgebot keys in the flow. Below is how to get a key from each of the 9 providers, what it costs, and how to connect it in Forgebot.

Checked: October 11, 2026. Provider dashboards change — if a button has a different name, look for the "API Keys" section.

1.Which provider to pick

We don't sell tokens or hand out our own keys: you pay the provider directly at its prices. Customer messages in this block go to the provider you choose.

ProviderFree to tryFor steady useServers
Anthropic (Claude)NoPrepaid creditsUS
OpenAI (ChatGPT)Yes, low limitsPurchases from $5 — Build tierUS
Google GeminiYes, free tierBilling + prepay from $5US
DeepSeekNoTop up: card, PayPal, Alipay, WeChat PayChina
Alibaba QwenYes, 90 days (Singapore region)Payment details in Alibaba CloudSingapore
xAI (Grok)NoPrepaid creditsUS
MistralYes, no card (Free mode)Pay-as-you-go in Admin PanelEU
Kimi (Moonshot)NoTop up from $1, WeChat Pay/Alipay onlyChina
OpenRouterYes, ":free" modelsAdd creditsUS (model-dependent)

To try it for free, use OpenRouter (a model with ":free" in its id) or Gemini. For steady use with real customers, use any paid key with a spending limit.

2.Anthropic (Claude)

Checked: October 11, 2026

  • Sign up at platform.claude.com (Claude Console).
  • Top up: Settings → Billing → Buy credits. The API does not work without credits — Anthropic's own docs say to "buy credits before you use the API". Credits expire one year after purchase.
  • Open Settings → API keys (platform.claude.com/settings/keys) → Create key.
  • Name the key, set an expiration, and make sure to pick a SINGLE workspace in the Workspace field. A key that works across all workspaces needs an anthropic-workspace-id header on every request — Forgebot does not send it, so such a key will be rejected.
  • Copy the key — shown once, starts with sk-ant-.

Spending limit: Settings → Billing → Spend limits. Each account tier has its own monthly cap; hitting it means waiting for the next month or asking for a raise.

3.OpenAI (ChatGPT, GPT)

Checked: October 11, 2026

  • Sign up at platform.openai.com.
  • Create a key: platform.openai.com/api-keys.
  • Add credits: Settings → Organization → Billing.
  • Copy the key in full.

Tiers: Free (low limits, not available in every country), Build after $5 in total purchases, Launch from $100, Grow from $500 (checked 2026-10-11). Hard spending cap: platform.openai.com/settings/organization/limits.

4.Google Gemini

Checked: October 11, 2026

  • Open Google AI Studio and sign in with a Google account (18+).
  • New users get a project and key created automatically after accepting the terms (confirmed 2026-10-11). Keys live on the API Keys page; need another one — Create API key.
  • For higher limits, press Set up billing and prepay at least $5.

There is a free tier, but with low limits. Google warns that on the free tier your prompts and responses may be used to improve Google products — use the paid tier for customer conversations.

Old unrestricted keys are rejected by the provider: keys created from 2026-05-28 are already the new "auth key" type — if an old key stops working, create a new one.

5.DeepSeek

Checked: October 11, 2026

  • Sign up at platform.deepseek.com.
  • Top up: platform.deepseek.com/top_up (PayPal, card, Alipay, WeChat Pay).
  • Create a key: platform.deepseek.com/api_keys.
  • Copy the key.

Your balance doesn't expire, and an unused balance can be refunded (Billing → Refunds). Out of money — the provider returns an insufficient-balance error. Servers are in China — Forgebot shows a warning under the model picker.

6.Alibaba Qwen (Model Studio)

Checked: October 11, 2026

  • Create an Alibaba Cloud international account: email, password, country (cannot be changed later), payment details.
  • Activate Model Studio and pick the Singapore region — the one we recommend.
  • In the Model Studio console: API Key → Create API Key — default workspace, All permissions.
  • Copy the key (starts with sk-) — it is shown only once.
  • Find your Workspace ID on the Workspace Management page: for the Singapore region Forgebot asks for it when you connect the key.

A key is locked to its region: a key from one region does not work in another. Forgebot accepts keys from two regions only — Singapore (recommended) and US (Virginia; not confirmed to work with Forgebot). Keys from China (Beijing), Germany (Frankfurt), Japan (Tokyo) and Hong Kong are not accepted by Forgebot — you will not be able to connect them.

Why the US is "not confirmed": as of 2026-10-11 Alibaba's own documentation contradicts itself — the regions table marks the address Forgebot uses for the US as not supported, while the endpoint reference lists it as still available. We have not tested this region with a live key. The 90-day free quota for new users is also Singapore-only — pick Singapore.

7.xAI (Grok)

Checked: October 11, 2026

  • Sign up at console.x.ai.
  • Add credits: the API does not work without them (confirmed 2026-10-11).
  • Create a key on the API Keys page in the console (console.x.ai → API Keys).
  • Copy the key.

xAI only spends prepaid credits: once they run out, requests are rejected. Auto top-up can be enabled from $5 per charge, with a monthly cap.

8.Mistral

Checked: October 11, 2026

  • Open console.mistral.ai and sign up.
  • On the left — API Keys → Create new key → a name and an expiration → Create new key.
  • Copy the key — shown once.

Free mode gives API access with no card, with a monthly allowance (confirmed 2026-10-11: "API access is enabled by default with no credit card required"). For more, turn on pay-as-you-go in Admin Panel → Subscription. Servers are in the EU.

9.Kimi (Moonshot)

Checked: October 11, 2026

  • Sign up at platform.kimi.ai.
  • Top up: at least $1 to start. Individuals can only pay via WeChat Pay and Alipay (QR code, confirmed 2026-10-11); businesses go through sales.
  • Create a key: platform.kimi.ai/console/api-keys.
  • Copy the key.

For Ukraine, Kazakhstan and most CIS countries, paying via WeChat Pay/Alipay is almost certainly a dead end — weigh that before picking Kimi. A key from another regional Kimi platform is rejected. Servers are in China.

10.OpenRouter

Checked: October 11, 2026

  • Sign up at openrouter.ai.
  • Create a key: openrouter.ai/settings/keys — give it a name and a credit limit (we recommend one).
  • Copy the key — starts with sk-or-v1-.
  • For paid models, add credits: openrouter.ai/settings/credits (cards, AliPay, crypto).

Free (":free") models: 20 requests per minute for everyone; 50 per day with under $10 in lifetime purchases, and 1,000 per day after $10+ in purchases (confirmed 2026-10-11).

11.Connect the key in Forgebot

  • Open Settings → the "AI Keys" tab.
  • Press Connect next to the provider you need.
  • Paste the key into the API Key field (for Qwen, also pick the Key Region — Singapore or US; for Singapore, enter the Workspace ID).
  • Press Save Key — it is stored encrypted, only the last 4 characters stay visible.
  • Press Verify.
StatusMeaningWhat to do
Not ConnectedNo key yetPress Connect
Not VerifiedSaved, not checked yetPress Verify
WorkingThe provider accepted the keyAdd the block to the flow
Key RejectedWrong, deleted or expired keyCreate a new key, press Replace
No CreditNo money or quota on the provider accountTop up, then Verify
Provider Did Not RespondA network issue or a provider outageTry again in a minute

For Anthropic, OpenAI, Gemini, DeepSeek and Mistral, Verify reads the free model list — "Working" means "key accepted", not "there is money on the account". For xAI, Qwen and Kimi it sends a tiny model request. For OpenRouter it reads the key's remaining limit.

The Connect / Replace / Delete buttons are visible only to someone with permission to manage AI keys.

12.Set up the AI-assistant block

Add the AI-assistant block to the flow and open its panel. The fields below follow the panel order and use the same names.

  • What the Assistant Does — "Replies to One Message" (one reply, then the flow moves on; the block is marked "one reply" on the canvas) or "Holds a Conversation Until the Goal Is Met" (the assistant answers every customer message until it reaches the goal you set; "conversation" on the canvas).
  • When the Goal Is Met — "conversation" mode only: the goal, up to 1,000 characters. Without it, such a block cannot be published.
  • Role & instructions — up to 4,000 characters: who the assistant is and how it replies. The customer never sees it.
  • Knowledge base — up to 20,000 characters: facts (menu, prices, hours, terms). Keep customer personal data out of it.
  • Provider — only providers with a connected key are listed.
  • Model — "Curated Models" (ones we tested) or "From Your Provider Account" (a live list from your own key).
  • AI Reply Limit per Person — optional: a number and a period (per minute, per hour or per day). On the free plan Forgebot already caps it at 20 replies a day per person (the field can only lower it); on a paid plan there is no cap by default, but we recommend setting one — otherwise a single person could spend as much as they want on your key.
  • New Conversation After Silence (min) — shown in "conversation" mode and when memory is on: 1 to 1,440, 30 by default. If the person stays silent that long, the assistant forgets the previous conversation, and in "conversation" mode the conversation ends via "silent/limit". With memory on, there is also an "Also on /start" switch (on by default). The reply limit is not reset by this.
  • Advanced — a collapsed section: "Remember the Chat Between Flow Runs" — the assistant remembers the conversation with this person even if the flow restarts (2 to 50 recent messages); "Max AI Replies per Conversation" — "conversation" mode only, up to 25 replies, 20 by default; "AI Reply" — "Send to the Customer" or "Save to a Variable Only" (the customer won't see the reply, it goes to {{ai_reply}}; not available in "conversation" mode); "If the AI Can't Reply, Message the Customer" — up to 1,000 characters; "Max reply length (characters)" — 50 to 3,500, 800 by default.

13.Connect the block outputs

In "one reply" mode the block has three outputs:

OutputWhen
repliedThe AI answered the customer
operatorThe AI decided to hand over (if "May call an operator" is on)
errorKey failed, no credit, a limit was hit, the provider did not respond

In "conversation" mode there are four outputs:

OutputWhen
doneThe AI decided the goal was reached
operatorThe AI decided to hand over
silent/limitThe customer didn't reply for the configured silence period, or the reply limit for one conversation was used up
errorKey failed, no credit, a limit was hit, the provider did not respond

Connect "error" to a "We'll get back to you shortly" message and/or an operator. If it is left unconnected, the bot continues on its own as if the AI stayed silent: in "one reply" mode via "replied", in "conversation" mode via "silent/limit". The customer then gets only the text from "If the AI Can't Reply, Message the Customer" (in Advanced), or nothing if that field is empty — so connecting "error" is worth doing.

The reason code is in {{last_ai_error.reason}} — you can branch the flow on it (for example, "no credit" → notify yourself, everything else → "we'll get back to you").

14.Forgebot limits

Free planPaid plan
AI replies per day per company100no Forgebot cap (you pay only the provider)
AI replies per day per person20 (can only be lowered in the block)no cap by default — set your own in the block
Reset00:00 UTC (03:00 Kyiv until October 25, 02:00 after; 05:00 Almaty), or right after buying a subscription—

/start and a new conversation after silence do NOT reset the reply limit — only the assistant's memory resets. The provider's own limits (per minute/day/month) apply on top, visible in its own dashboard.

15.What happens when the key runs out of money or doesn't fit

  • The provider refuses → the block takes the "error" output, reason no_credit.
  • AI Keys shows "No Credit", and the block panel shows a warning.
  • To avoid hammering the provider, the block skips it for 5 minutes and goes straight to "error", then tries again.
  • Top up → press Verify → it recovers on its own.

A rejected key (deleted, expired, wrong) isn't used again until you replace it or press Verify.

16.Error reason codes

The code lives in {{last_ai_error.reason}} — use it in a Filter block condition to handle different reasons differently.

CodeWhat happenedWhat to do
no_keyNo key is connected.Connect a key
invalid_keyThe provider rejected the key: make sure it was copied in full and has not been revoked.Create a new key, press Replace
no_creditThe provider account is out of credit or quota.Top up, or raise the spending limit
rate_limitedThe provider is rate-limiting requests. Try again later.Wait; if it keeps happening, raise your tier with the provider
provider_unavailableThe provider is temporarily unavailable or overloaded.Wait and retry
timeoutThe provider did not respond in time.Wait, or pick a faster model
model_not_foundThe provider has no such model, or the key has no access to it.Pick another model
bad_requestThe provider rejected the request.Check the region and the key settings
too_longThe request is too long for this model.Shorten the knowledge base
refusedThe model or provider declined the request under its safety rules.Rephrase the role
empty_replyThe model returned an empty reply.Retry; try another model
too_largeThe provider response is too large.Lower the max reply length
daily_limitThe daily AI call limit of your plan is used up.Wait for the 00:00 UTC reset, or move to a paid plan
contact_limitThis contact has used up the AI request limit for the period.Wait for the limit period to reset
loop_limitToo many AI calls in one dialog — looks like a loop in the flow.Check how the blocks are wired
concurrency_limitToo many simultaneous AI requests in your company.Wait a bit
busyThe AI service is busy with other companies right now.Try again in a minute
send_failedTelegram does not accept messages for this chat (e.g. the contact blocked the bot).—
internalA temporary error on our side.Retry later
config_invalidThe node isn't fully set up: pick a model and fill in the role.Fill in the role and pick a model

17.Tips

  • Set a spending limit at the provider — it's your fuse against a surprise bill.
  • Connect the "error" output to a "We'll get back to you shortly" message and to an operator.
  • Start with a cheap, fast model from "Curated Models"; switch to an expensive one only if replies disappoint.
  • Put facts in the knowledge base, not in the role: the role is "how to talk", the base is "what to say".
  • Don't store customer personal data in the role or the knowledge base.
  • For stricter privacy, pick providers with servers in the US or EU: DeepSeek and Kimi run in China.
FAQ

Frequently asked questions

Do I pay Forgebot for AI?

No. AI replies are billed to your provider account. There are no Forgebot keys in the flow. On Forgebot's free plan you get up to 100 AI replies a day per company.

Can it be completely free?

For trying it out, yes: OpenRouter's ":free" models (50 requests a day) or Gemini's free tier. For real customers use a paid key — free options have small limits, and on Gemini's free tier your requests may be used to improve Google products.

Status says "Working", but the block still takes "error". Why?

Check the code in {{last_ai_error.reason}} or the run log. Most often it's no_credit: for Anthropic, OpenAI, Gemini, DeepSeek and Mistral, verifying the key reads the free model list and can't see an empty balance.