diff --git a/.openclaw-sync/source.json b/.openclaw-sync/source.json index 7fcdd3d20..d6b1b90d5 100644 --- a/.openclaw-sync/source.json +++ b/.openclaw-sync/source.json @@ -1,5 +1,5 @@ { "repository": "openclaw/openclaw", - "sha": "930d81aa41d26ef72343c88c0acefa25596d900a", - "syncedAt": "2026-04-25T18:05:43.137Z" + "sha": "c3bfd328ad36a88d6a20e654436ff20275429271", + "syncedAt": "2026-04-25T18:07:46.467Z" } diff --git a/docs/providers/litellm.md b/docs/providers/litellm.md index 65f0c75c6..617bd545f 100644 --- a/docs/providers/litellm.md +++ b/docs/providers/litellm.md @@ -108,6 +108,38 @@ export LITELLM_API_KEY="sk-litellm-key" ## Advanced configuration +### Image generation + +LiteLLM can also back the `image_generate` tool through OpenAI-compatible +`/images/generations` and `/images/edits` routes. Configure a LiteLLM image +model under `agents.defaults.imageGenerationModel`: + +```json5 +{ + models: { + providers: { + litellm: { + baseUrl: "http://localhost:4000", + apiKey: "${LITELLM_API_KEY}", + }, + }, + }, + agents: { + defaults: { + imageGenerationModel: { + primary: "litellm/gpt-image-2", + timeoutMs: 180_000, + }, + }, + }, +} +``` + +Loopback LiteLLM URLs such as `http://localhost:4000` work without a global +private-network override. For a LAN-hosted proxy, set +`models.providers.litellm.request.allowPrivateNetwork: true` because the API key +will be sent to the configured proxy host. + Create a dedicated key for OpenClaw with spend limits: diff --git a/docs/tools/image-generation.md b/docs/tools/image-generation.md index e4ee385ee..715b11ae5 100644 --- a/docs/tools/image-generation.md +++ b/docs/tools/image-generation.md @@ -1,5 +1,5 @@ --- -summary: "Generate and edit images using configured providers (OpenAI, OpenAI Codex OAuth, Google Gemini, OpenRouter, fal, MiniMax, ComfyUI, Vydra, xAI)" +summary: "Generate and edit images using configured providers (OpenAI, OpenAI Codex OAuth, Google Gemini, OpenRouter, LiteLLM, fal, MiniMax, ComfyUI, Vydra, xAI)" read_when: - Generating images via the agent - Configuring image generation providers and models @@ -53,6 +53,7 @@ The agent calls `image_generate` automatically. No tool allow-listing needed — | OpenAI image generation with API billing | `openai/gpt-image-2` | `OPENAI_API_KEY` | | OpenAI image generation with Codex subscription auth | `openai/gpt-image-2` | OpenAI Codex OAuth | | OpenRouter image generation | `openrouter/google/gemini-3.1-flash-image-preview` | `OPENROUTER_API_KEY` | +| LiteLLM image generation | `litellm/gpt-image-2` | `LITELLM_API_KEY` | | Google Gemini image generation | `google/gemini-3.1-flash-image-preview` | `GEMINI_API_KEY` or `GOOGLE_API_KEY` | The same `image_generate` tool handles text-to-image and reference-image @@ -67,6 +68,7 @@ ignored when a provider does not support them. | ---------- | --------------------------------------- | ---------------------------------- | ----------------------------------------------------- | | OpenAI | `gpt-image-2` | Yes (up to 4 images) | `OPENAI_API_KEY` or OpenAI Codex OAuth | | OpenRouter | `google/gemini-3.1-flash-image-preview` | Yes (up to 5 input images) | `OPENROUTER_API_KEY` | +| LiteLLM | `gpt-image-2` | Yes (up to 5 input images) | `LITELLM_API_KEY` | | Google | `gemini-3.1-flash-image-preview` | Yes | `GEMINI_API_KEY` or `GOOGLE_API_KEY` | | fal | `fal-ai/flux/dev` | Yes | `FAL_KEY` | | MiniMax | `image-01` | Yes (subject reference) | `MINIMAX_API_KEY` or MiniMax OAuth (`minimax-portal`) |