Skip to main content

Install

Setup

Basic chat

Streaming

With fetch (no SDK)

Generating images and videos

Image and video models use a separate async endpoint. POST to /v1/images/generations or /v1/videos/generations, get a job_id back, poll /v1/jobs/{id} until status is succeeded. Use fetch directly - the OpenAI SDK does not cover these endpoints.
Same pattern for /v1/images/generations: swap the model (flux-1.1-ultra, ideogram-v3, recraft-v3, flux-kontext-pro) and omit duration.