#Model keeps on failing

1 messages · Page 1 of 1 (latest)

livid ridge
#

Despite having set up fallback for the model with this configuration:

  "models": {
    "google-vertex/gemini-3-flash-preview": {"alias": "flash3"},
    "google-vertex/gemini-2.5-flash": {"alias": "flash2"}
  },
  "model": {
    "primary": "google-vertex/gemini-2.5-flash",
    "fallbacks": [
      "google-vertex/gemini-3-flash-preview"
    ]
  }

I am still getting random failures and responses from my agent over telegram saying:

⚠️ 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.

How can I configure the agent to better handle this error conditions to retry?

NOTE: The API KEY has NOT run out of credits or insufficient balance. Subsequent messages are handled correctly.

molten mulchBOT
#

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

livid ridge
#

@humble flint can I configure some backoff parameters so that it doesn't just fail, but retries? Also can I specify the location of the model I want to use like this?

"models": {
"google-vertex/gemini-3-flash-preview": {"alias": "flash3", "location": "us-central1"},
"google-vertex/gemini-2.5-flash": {"alias": "flash2", "location": "europe-west2"}
}

humble flintBOT
# livid ridge <@1457407575476801641> can I configure some backoff parameters so that it doesn'...

For LLM/model calls there isn’t currently a user-facing “retry/backoff” knob like attempts/minDelay/maxDelay that will re-run the same failed model request with delays.

What OpenClaw does have instead:

There is configurable retry/backoff, but it’s for channel outbound calls (Discord/Telegram message sends/uploads), not model inference:
Docs: https://docs.openclaw.ai/concepts/retry


Vertex “location” / region

That location key won’t work where you put it (and OpenClaw’s model catalog entries only allow alias, params, streaming).

For google-vertex, the underlying provider requires a location via environment:

#
  • GOOGLE_CLOUD_LOCATION (e.g. us-central1, europe-west2)
  • and a project via GOOGLE_CLOUD_PROJECT (or GCLOUD_PROJECT)

So configure it as env on the Gateway (or in ~/.openclaw/.env, or via the env block in config). Env docs: https://docs.openclaw.ai/help/environment

Example:

{
env: {
GOOGLE_CLOUD_PROJECT: "my-gcp-project",
GOOGLE_CLOUD_LOCATION: "us-central1",
},
agents: {
defaults: {
models: {
#
"google-vertex/gemini-3-flash-preview": { alias: "flash3" },
"google-vertex/gemini-2.5-flash": { alias: "flash2" },
},
},
},
}

Note: with the current setup, location is effectively “per Gateway process” (env), not per-model. If you truly need two locations at once, that’d need separate gateway instances (or a feature request to plumb location through per-request).

patent spruce
#

@humble flint how do I add OpenClaw Bot on Discord?

humble flintBOT
# patent spruce <@1457407575476801641> how do I add OpenClaw Bot on Discord?

OpenClaw doesn’t have a single “public bot” you can invite — you create your own Discord app/bot in the Discord Developer Portal, then point your OpenClaw gateway at its token.

Steps (guild/server install):

  1. Discord Developer Portal → Applications → New Application
  2. Bot → Add Bot → copy the Bot Token
  3. Bot → Privileged Gateway Intents → enable:
    • Message Content Intent (required in most servers)
    • (optional) Server Members Intent (needed for some allowlists/name lookups)
  4. OAuth2 → URL Generator
    • Scopes: bot + applications.commands
    • Permissions (minimal): View Channels, Send Messages, Read Message History (plus Attach Files/Embed Links if you want)
    • Open the generated URL → pick your server → Authorize
  5. Configure OpenClaw with the token and restart: