OpenAI and LiteLLM
Tools built for the OpenAI Images or Videos API, or for a LiteLLM proxy, work with Eden Gen by changing the base URL to https://edengen.ai/v1. Every request becomes a take, so project caps, refunds, webhooks and usage reports apply as usual.
Images
POST /v1/images/generations waits for the files like OpenAI does, up to 110 s. size maps to the closest aspect ratio and resolution the model offers. n goes up to 4.
from openai import OpenAI
client = OpenAI(base_url="https://edengen.ai/v1", api_key="tk_your_key")
img = client.images.generate(model="nano-banana-pro", prompt="Espresso pouring in amber backlight, black background", size="1024x1280")
print(img.data[0].url)Videos
POST /v1/videos starts a take and returns at once. Poll GET /v1/videos/{id} until status is completed, then read /content. seconds must be one of the model's lengths. input_reference becomes the first frame when the model takes one, otherwise a reference. /remix re-renders with a new prompt and the same settings.
import time
video = client.videos.create(model="seedance-2.5", prompt="Slow push in on a lighthouse in a storm, no music", seconds="5", size="1280x720")
while video.status in ("queued", "in_progress"):
time.sleep(10)
video = client.videos.retrieve(video.id)
client.videos.download_content(video.id).write_to_file("lighthouse.mp4")From a LiteLLM proxy
Add Eden Gen models to your config.yaml as OpenAI deployments. Your LiteLLM keys, budgets and logs keep working, and Eden Gen handles the providers, refunds and invoices behind them.
model_list:
- model_name: seedance-2.5
litellm_params:
model: openai/seedance-2.5
api_base: https://edengen.ai/v1
api_key: os.environ/EDEN_GEN_API_KEY
- model_name: nano-banana-pro
litellm_params:
model: openai/nano-banana-pro
api_base: https://edengen.ai/v1
api_key: os.environ/EDEN_GEN_API_KEYOr call it from the LiteLLM SDK directly, without a proxy:
import litellm
img = litellm.image_generation(model="openai/nano-banana-2.1", prompt="A lone kayak on a glacier lagoon", size="1536x1024",
api_base="https://edengen.ai/v1", api_key="tk_your_key")
video = litellm.video_generation(model="openai/seedance-2.5", prompt="Slow push in on a lighthouse in a storm, no music",
seconds="5", size="1280x720", api_base="https://edengen.ai/v1", api_key="tk_your_key")
status = litellm.video_status(video_id=video.id, model="openai/seedance-2.5", api_base="https://edengen.ai/v1", api_key="tk_your_key")
mp4 = litellm.video_content(video_id=video.id, model="openai/seedance-2.5", api_base="https://edengen.ai/v1", api_key="tk_your_key")Differences from OpenAI
| Field | Here |
|---|---|
model | An Eden Gen model id from GET /v1/models. OpenAI names like dall-e-3 or sora-2 return 404. |
project_id | Extra. Bills the take to a project; also the X-Eden-Project header. Defaults to the key's project. |
cost_usd | Extra on every video object. Failed takes are refunded and show a failed status with an error. |
quality, style | Accepted and ignored. Resolution comes from size. |
X-Takes-Tags | Header for usage tags, e.g. client=acme,campaign=q4. |