litellm - ✅(Solved) Fix [Bug]: xAI image model `grok-imagine-image` not supported via /images endpoints (no healthy deployments) [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#26184Fetched 2026-04-22 07:45:55
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×2cross-referenced ×1referenced ×1

Error Message

Error: 400 litellm.BadRequestError: You passed in model=xai/grok-imagine-image. There are no healthy deployments for this model. Received Model Group=xai/grok-imagine-image Available Model Group Fallbacks=None

Fix Action

Fixed

PR fix notes

PR #26189: fix(xai): register grok-imagine-image for image generation

Description (problem / solution / changelog)

Summary

Fixes #26184.

  • Register xai/grok-imagine-image in the model cost map with mode: image_generation, supported_endpoints including /v1/images/generations, and per-image pricing from xAI docs.
  • Resolve default api_base and API key for xAI in litellm.image_generation via XAIChatConfig._get_openai_compatible_provider_info (same as chat), so OpenAI-compatible image calls hit https://api.x.ai/v1 without requiring explicit deployment api_base.
  • Add mocked unit tests for model map metadata and default api_base.

Testing

  • uv run pytest tests/test_litellm/llms/xai/test_xai_image_generation.py tests/test_litellm/images -q
  • CI-style: cd litellm && uv run black --check --exclude '/enterprise/' . (ruff, mypy as in workflow)

CLA

Contributor must complete the LiteLLM CLA if not already signed.

Changed files

  • litellm/images/main.py (modified, +27/-18)
  • litellm/llms/xai/image_credentials.py (added, +54/-0)
  • litellm/model_prices_and_context_window_backup.json (modified, +16/-22)
  • model_prices_and_context_window.json (modified, +9/-0)
  • tests/local_testing/test_xai_image_credentials.py (added, +31/-0)
  • tests/test_litellm/llms/xai/test_xai_image_generation.py (added, +42/-0)
  • uv.lock (modified, +2/-2)

Code Example

Error: 400 litellm.BadRequestError: 
You passed in model=xai/grok-imagine-image. 
There are no healthy deployments for this model.
Received Model Group=xai/grok-imagine-image
Available Model Group Fallbacks=None

---

Error fetching response:
Error: 400 litellm.BadRequestError: 
You passed in model=xai/grok-imagine-image. 
There are no healthy deployments for this model.

Received Model Group=xai/grok-imagine-image
Available Model Group Fallbacks=None
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

When trying to use the xAI image model grok-imagine-image via LiteLLM, the model cannot be used with image endpoints. • The model is correctly added as xai/grok-imagine-image • The xAI provider is configured with a valid API key • The endpoint is set to /v1/images/edits (also tested /v1/images/generations)

However, LiteLLM returns:

Error: 400 litellm.BadRequestError: 
You passed in model=xai/grok-imagine-image. 
There are no healthy deployments for this model.
Received Model Group=xai/grok-imagine-image
Available Model Group Fallbacks=None

Additionally, when using default behavior, LiteLLM routes the request to: /v1/chat/completions

which results in: XaiException - Model not found: grok-imagine-image

Expected behavior LiteLLM should: • Support xai/grok-imagine-image for image generation • Route requests to the correct endpoint: POST https://api.x.ai/v1/images/generations Treat this model as an image model, not a chat model

Steps to Reproduce

  1. Go to Models + Endpoints
  2. Add a new model: • Provider: xAI • Model: xai/grok-imagine-image
  3. Go to Playground
  4. Set: • Endpoint: /v1/images/edits (also tested /v1/images/generations) • Model: xai/grok-imagine-image
  5. Send a request

Relevant log output

Error fetching response:
Error: 400 litellm.BadRequestError: 
You passed in model=xai/grok-imagine-image. 
There are no healthy deployments for this model.

Received Model Group=xai/grok-imagine-image
Available Model Group Fallbacks=None

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.83.7

Twitter / LinkedIn details

No response

extent analysis

TL;DR

The issue can be resolved by ensuring that the xAI model grok-imagine-image is properly deployed and healthy, and configuring LiteLLM to correctly route requests for this model to the image generation endpoint.

Guidance

  • Verify that the grok-imagine-image model is correctly deployed and healthy on the xAI platform, as the error message suggests that there are no healthy deployments for this model.
  • Check the LiteLLM configuration to ensure that the xai/grok-imagine-image model is correctly mapped to the image generation endpoint (/v1/images/generations).
  • Test the model with a different endpoint, such as /v1/images/edits, to see if the issue is specific to one endpoint.
  • Review the LiteLLM documentation to ensure that the xai/grok-imagine-image model is supported and properly configured.

Example

No code snippet is provided as the issue seems to be related to configuration and deployment rather than code.

Notes

The issue may be specific to the grok-imagine-image model or the xAI platform, and further investigation may be required to determine the root cause.

Recommendation

Apply workaround: Verify the model deployment and configure LiteLLM to correctly route requests for the xai/grok-imagine-image model to the image generation endpoint, as the issue seems to be related to configuration and deployment rather than a version-specific bug.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - ✅(Solved) Fix [Bug]: xAI image model `grok-imagine-image` not supported via /images endpoints (no healthy deployments) [1 pull requests, 1 participants]