#"Hide" certain OpenClaw errors?

1 messages · Page 1 of 1 (latest)

proven kestrel
#

I'm using OpenClaw with Opus 4.6 and Discord. Recently my bot has been giving these errors:

"⚠️ API provider returned a billing error — your API key has run out of credits or has an insufficient balance. Check your provider's billing dashboard and top up or switch to a different API key."

Interestingly, it appears these errors are getting falsely reported. My bot is claiming that its not seeing these errors on its backend and that its able to respond to me just fine. I can confirm this by prompting it for things like "Your last message didn't send, can you repeat it?" and it will send me the correct response without the error popping up. In fact, according to my bot, its saying these errors occur after it runs all its API calls.

If this is just some sort of benign weirdness with OpenClaw, it seems like the easiest thing to do is just to cut whatever part of the program is causing these errors to show in place of my bot's response. Currently its annoying for me because, on the discord side, if my bot runs into any issue it only shows me this error and none of the work it did before that. Is there a way I can either expand what my bot sends to me via discord (so that the error still pops up but I do see their message), or we just put an ignore on the api provider error so that the thing that gets sent to the channel is indeed the response?

errant streamBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

stoic fulcrumBOT
# proven kestrel I'm using OpenClaw with Opus 4.6 and Discord. Recently my bot has been giving th...

That warning almost never comes from “nowhere” — what’s usually happening is:

  • the main chat completion succeeds (so the agent did generate a reply), but then
  • a secondary provider call (common culprits: memory search embeddings indexing, compaction/memory-flush, TTS summary, or a fallback model probe) hits a 402 / insufficient credits, and
  • Discord ends up showing only the final error for the turn.

So “repeat it” works because the session state still has enough context to regenerate (or it already computed it), but the turn still ended in an error path.

1) Get the real source of the 402 (fastest way)

Can you paste the output of these (in a code block)? status --all is designed to be shareable (tokens redacted):

openclaw --version
openclaw status --all
openclaw models status
openclaw logs --limit 200
#

That will usually reveal which provider/model is actually throwing the billing error (often it’s not your primary “Opus” model).

Docs for the triage loop: https://docs.openclaw.ai/help/faq#first-60-seconds-if-somethings-broken

2) Quick workaround so you see the reply even if a later step fails

Enable block streaming for Discord. This makes OpenClaw flush text earlier, so if some “after” step errors, you’ll still have already received the content.

Config knobs (from the config reference):

{
  agents: { defaults: { blockStreamingDefault: "on" } },
  channels: {
    discord: {
      blockStreaming: true,
      // optional: send earlier/smaller chunks while debugging
#
      blockStreamingCoalesce: { idleMs: 400, minChars: 400 }
    }
  }
}

Then restart the gateway.

(Ref: block streaming section in config docs) https://docs.openclaw.ai/gateway/configuration

3) Very common root cause: embeddings/memory search uses OpenAI credits

Even if your chat model is Anthropic, memory search embeddings can use OpenAI/Gemini and can throw billing errors if that key is empty/out-of-credit.

Relevant doc: https://docs.openclaw.ai/concepts/memory
FAQ note: https://docs.openclaw.ai/help/faq#does-semantic-memory-search-require-an-openai-api-key

#

Once you paste status --all / logs, we can tell you exactly which subsystem is making the failing call and the cleanest fix (top up that provider, remove it from fallbacks, or switch that feature to a provider you actually want).

proven kestrel
#

It is not actually related to embeddings, or anything I can tell -- we were able to rule that out in a different thread. I'm not sure how sandboxed your AI is, but its available in this same 'help' forum under the name 'API Provider billing error -- but can't track error source'. To sum it up, all status updates show openai's embeddings working properly, it gives no errors in the logs, and the "unusable Profiles" show no answers (let alone ones related to billing).

Is there a way to enable block streaming through openclaw config command? Or do you just want me to edit the raw config

stoic fulcrumBOT
# proven kestrel It is not actually related to embeddings, or anything I can tell -- we were able...

Yep — you can do it via the CLI config helper (openclaw config set). No need to hand-edit the raw JSON5 unless you prefer it.

Minimal “make Discord flush text early” setup:

openclaw config set agents.defaults.blockStreamingDefault "on"
openclaw config set channels.discord.blockStreaming true
openclaw gateway restart

Optional (recommended) to avoid Discord getting spammy — coalesce smaller chunks while you debug:

openclaw config set channels.discord.blockStreamingCoalesce '{ idleMs: 400, minChars: 400 }' --json
openclaw gateway restart