https://retellai.com/?utm_source=discord&utm_medium=seo logo
Hi, We’re using the Retell Chat Widget on producti...
# ❓・ai-evy-support
k
@AI Evy Hi, We’re using the Retell Chat Widget on production and see a consistent 2–3s delay after clicking the chat icon before the chat becomes ready. What we’ve checked: The widget script loads fast: https://dashboard.retellai.com/retell-widget.js ~100ms (cached). The slowdown happens after click, during API calls: create-chat has a CORS preflight OPTIONS ~450–470ms then create-chat-completion takes ~3.0s TTFB (sometimes another call ~1.7s) Page performance is fine (LCP ~1.4s, INP ~24ms). The UI itself is not the bottleneck — network/TTFB is. Question: Is the delay expected because create-chat-completion triggers an LLM response (welcome message) on open? Is there a recommended way to make the chat open instantly (e.g., disable auto-completion / welcome generation on open, or preload create-chat in the background)? Any guidance to reduce create-chat-completion latency (config flags/features marked as “slow/turtle”, model choice, etc.)? Any recommendations to reduce/remove the CORS preflight overhead for widget endpoints?
a
Thanks for tagging me @kirilltaneev. I'll look through relevant sources and get back to you shortly.
ocumentation]() - Visit [Hire certified Retell partner]() Would you like me to provide a general answer based on broader knowledge about optimizing chat widget initialization patterns?
### Answer The delay you're experiencing is likely related to the LLM response generation during
create-chat-completion
. Based on the available documentation, here's what I can share: ## Why the Delay Occurs Yes, the
create-chat-completion
endpoint generates an agent response, which involves LLM processing. [(1) ]() The API returns the agent's response in the
messages
array after processing the user message through the language model. [(2) ]() ## Model Selection for Latency Reduction For chat agents, you can configure the underlying LLM model. Based on the changelog, here are latency/price comparisons for available models: [(3) ]() Latency (lower is faster) : GPT 4.1 nano < GPT 4.1 mini < GPT 4o mini < GPT 4o < GPT 4.1 If you're currently using a higher-latency model like GPT-4o or GPT-4.1, switching to GPT-4.1 nano or GPT-4.1 mini could significantly reduce response times. ## What the Documentation Doesn't Cover Unfortunately, the available sources don't explicitly document: - Widget-specific configuration options for preloading
create-chat
in the background - Options to disable automatic welcome message generation on chat open - CORS preflight configuration for widget endpoints - Specific "slow/fast" feature flags for chat completion ## Recommended Next Steps Check out these potentially useful sources: - [Create Chat Completion]() - [Create Chat Agent]() - [Platform Changelogs]() For the specific widget optimization questions (preloading, disabling welcome messages, CORS configuration) , I'd recommend reaching out directly: - Visit [D
​ To learn more, see the sources I considered: [[1] Create Chat Completion](https://docs.retellai.com/api-references/create-chat-completion) [[2] Create Chat Completion](https://docs.retellai.com/deploy/create-chat-completion) [[3] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.