Skip to main content

Install

Setup

Basic chat

Streaming

With fetch (no SDK)

Generating images and videos

Image models use a separate async endpoint. POST to /v1/images/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.
Other image models work the same way: swap the model (recraft-v4, ideogram-v3, or flux-kontext-pro with an image_url). /v1/videos/generations takes the same shape plus duration_s, with veo-3.1-fast.