Skip to main content

Troubleshooting - LLM Completion

Common LLM Completion errors and what to do about them​

While you are building an AI chatbot flow, an LLM Completion node can fail for reasons that lie outside it or in how it is configured.

Here are the situations that come up most often.

1 Context window exceeded​

What happens​

If the prompt or the conversation history is longer than the number of tokens the model allows (128k for GPT-4o, 4k for gpt-4o-mini), the call errors.

What to do​

  • Check whether the input is too long, particularly the chat history or embedded data.
  • Use MaxToken to cap the output length so it cannot overflow.
  • To reproduce this on purpose, set MaxToken to 0.

2 Not enough credit, or billing not enabled on the OpenAI account​

What happens​

If the OpenAI account has no payment method enabled, or its quota is used up, the model cannot answer.

What to do​

  • Sign in to OpenAI and confirm that a payment method is attached to the account.
  • Check the account's API usage and remaining quota.

3 Wrong or expired API key​

What happens​

An API key that is mistyped, expired or invalid gets the request rejected.

What to do​

  • Check that the API key was pasted correctly, with no stray spaces or characters.
  • On a team account, ask the administrator or the teaching assistant for a current key.