AI explained

Claude API for support bots: a production-readiness list

A support bot that calls a model API fails in ordinary ways: slow replies, outages, leaked keys, bad inputs. A production-readiness list with a retry example to adapt.

By the Askocto team · · 4 min read

If you build a support bot on the Claude API, the model call is a dependency that will sometimes be slow, busy or unavailable, and customers will hit those moments. This article is a production-readiness list for any bot that calls a model API directly. It does not describe the API itself, so use the provider's current documentation for request formats, limits and terms. It covers what your own code has to do around the call.

In short: Treat the model call as an unreliable network dependency. Set timeouts, retry with backoff, keep keys on the server, version your instructions, check inputs and outputs, and log carefully.

Treat the call as unreliable

A model call can be slow, can fail, or can return something your code did not expect. Plan for each:

  • Timeouts. Decide how long a customer waits. Past that point, show a short message and offer a person.
  • Retries. Retry only failures that may pass on a second try, with a growing wait between tries and a small cap.
  • Rate limits. The provider documents its current limits. Handle the "slow down" response by waiting, not by retrying at once.
  • Fallback. When the call keeps failing, tell the customer plainly and route them to email or a person.

A retry wrapper in JavaScript shows the pattern:

async function callWithRetry(makeRequest, { tries = 3, baseMs = 500 } = {}) {
  for (let attempt = 1; attempt <= tries; attempt++) {
    try {
      const res = await makeRequest({ signal: AbortSignal.timeout(20000) })
      if (res.ok) return await res.json()
      const retryable = res.status === 429 || res.status >= 500
      if (!retryable || attempt === tries) throw new Error(`status ${res.status}`)
      const wait = Number(res.headers.get("retry-after")) * 1000 || baseMs * 2 ** attempt
      await new Promise((r) => setTimeout(r, wait))
    } catch (err) {
      if (attempt === tries) throw err
      await new Promise((r) => setTimeout(r, baseMs * 2 ** attempt))
    }
  }
}

Tune the timeout and the number of tries to your channel. A chat window tolerates a few seconds. A voice call does not.

The readiness table

Risk Control How to test it
Slow or failed call Timeout, capped retries, fallback message Block the network and watch the customer view
Leaked key Key on the server, loaded from the environment, rotated on a schedule Search your front-end bundle and repository for it
Silent prompt edits Instructions in version control with a change note Compare two versions on your test set
Prompt injection Rules in instructions and checks outside the model Send "ignore your rules" messages
Personal data in logs Redact before storing, set a retention period Read a day of logs
Wrong answers Retrieval from your sources, a decline rule, review Run 50 questions, 10 of them traps
No human path Handoff with transcript and summary Ask for a person in every channel
Cost surprises Usage alerts, limits per session Run a long conversation and read the usage

Work through the table with the people who will be paged when it fails. An item with no owner is an item that will fail.

Keys and secrets

Keys belong in server-side configuration, never in a web page, a mobile app bundle or a public repository. Give each environment its own key, rotate on a schedule, and revoke on a leak. For the chat window itself, your server should be the only thing that talks to the provider. If a customer's browser can call the model directly, anyone can.

Version your instructions

The instructions that shape the bot are code in effect. Store them in version control, require a note for each change, and run your test set before and after. A single added sentence can shift behavior in unexpected cases, as the upgrade playbook for Claude 4 shows for model changes.

Check inputs and outputs

  • Inputs: cap message length, strip attachments you do not handle, and watch for attempts to override instructions.
  • Outputs: run checks before the answer reaches a customer, such as forbidden phrases, price patterns you never want quoted, or missing disclosure.

Checks outside the model are your safety net, because model instructions alone are not guaranteed to hold.

Log with care

Logs help you review quality and debug. They also hold customer data. Store the question, the answer and the sources used, redact personal details, set a retention period and restrict access. This is not legal advice, so involve your privacy contact. Security questions for AI support vendors lists the questions to ask of a vendor, which you can turn on yourself as a checklist.

The platform alternative

Everything above is work a platform takes on. Askocto, for example, returns structured errors, including a rate_limited code with a Retry-After header that your client can obey, as described in its error handling reference, and it adds handoff, logs and versions around the model. See the ChatGPT API guide for a plan of what building it yourself involves, and the DeepSeek API guide for how to design so you can change providers. If you would rather evaluate a ready platform, the product overview is the place to begin.

Frequently asked questions

Is the Claude API enough to build a customer support bot?

It is the model component. You add retrieval, memory, rules, handoff, logging and monitoring to make a bot you can trust with customers.

How do I handle API rate limits in a support bot?

Read the provider's current limits, wait and retry with backoff when you get a slow-down response, and show a fallback message if it keeps failing.

Where should I store my API key?

On your server, in environment configuration. Never in front-end code, mobile apps or a repository.

Can I skip building all of this?

If you use a support platform such as Askocto, retries, handoff, logs and versions come with it, and you configure the agent instead of writing the service.

Train an agent on your own help center

Askocto answers the repeat questions across chat, email and voice and hands the hard ones to your team.

Keep reading

All articles
AI explainedembed chatgpt on your website
Jun 16, 20254 min read

How to embed ChatGPT on your website safely

A chat box on your site is the easy part. Keeping keys private, limiting scope and handing off to people is the real work. See the safe pattern and an example embed.

Read article
AI explainedgemini 3.6 flash
Feb 15, 20264 min read

Gemini 3.6 Flash: test speed against answer quality

Fast models are tempting for chat and voice, but speed is only worth it if answers stay right. A protocol to measure latency and quality together on your own conversations.

Read article
AI explainedkimi k2 api
Feb 13, 20264 min read

Kimi K2 API for support: an integration checklist

Using a model API in support means planning for slow calls, errors and changes. A pre-flight checklist and a thin wrapper keep Kimi K2 or any provider swappable.

Read article