> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prismgateway.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Image and video examples

> OpenAI-style media requests for Seedream, Seedance, HappyHorse 1.1, and HappyHorse-compatible video jobs.

# Image and video examples

Use the same Facade host and Prism API key as chat completions. The examples below assume:

```bash theme={null}
export PRISM_BASE_URL="https://api.prismgateway.io/v1"
export PRISM_API_KEY="sk-prism-..."
```

Use `GET /v1/models` or the console model catalog to choose a public model ID for your org. The sample IDs below show the expected request shapes; replace them with the IDs published in your catalog.

## Image generation

`POST /v1/images/generations` accepts OpenAI-style image generation bodies. Facade authenticates the customer key, checks catalog visibility and credits, then routes the request through the configured image runtime.

```bash theme={null}
curl -sS "$PRISM_BASE_URL/images/generations" \
  -H "Authorization: Bearer $PRISM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedream-5-0-260128",
    "prompt": "A clean product render of a translucent prism gateway device on a white desk",
    "size": "1024x1024",
    "n": 1
  }'
```

The response follows the OpenAI image shape when the selected runtime supports it:

```json theme={null}
{
  "created": 1779091200,
  "data": [
    {
      "url": "https://..."
    }
  ]
}
```

## Text-to-video

Create video jobs with `POST /v1/video/generations`. Video is asynchronous: store the returned job ID, then poll `GET /v1/video/generations/{jobId}`.

```bash theme={null}
curl -sS "$PRISM_BASE_URL/video/generations" \
  -H "Authorization: Bearer $PRISM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-1.0-pro-fast",
    "prompt": "A cinematic dolly shot through a glass API gateway room, soft reflections, product demo style",
    "duration": 5,
    "resolution": "1080p",
    "aspectRatio": "16:9",
    "generateAudio": true
  }'
```

## Image-to-video

Send a hosted image URL with the video request. `prompt` may describe the motion; media-only requests are accepted by video runtimes that support image or reference inputs.

```bash theme={null}
curl -sS "$PRISM_BASE_URL/video/generations" \
  -H "Authorization: Bearer $PRISM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-1.0-pro-fast",
    "prompt": "Animate the product with a slow clockwise camera move and subtle light sweep",
    "imageUrl": "https://cdn.example.com/prism/product-frame.png",
    "duration": 5,
    "resolution": "1080p",
    "aspectRatio": "16:9"
  }'
```

## HappyHorse 1.1 text-to-video

HappyHorse 1.1 is the latest Alibaba video model with cinematic lighting, stable camera movements, and native audio generation. Use `happyhorse-1.1-t2v` for text-to-video.

```bash theme={null}
curl -sS "$PRISM_BASE_URL/video/generations" \
  -H "Authorization: Bearer $PRISM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse-1.1-t2v",
    "prompt": "A cinematic aerial shot of a tropical island at golden hour, lush vegetation and crystal-clear water",
    "duration": 5,
    "resolution": "1080p",
    "aspectRatio": "16:9",
    "generateAudio": true
  }'
```

## HappyHorse reference-to-video

HappyHorse-compatible request shapes support `imageUrls` for multi-reference video generation and audio controls such as `generateAudio` and `refAudioUrl`.

```bash theme={null}
curl -sS "$PRISM_BASE_URL/video/generations" \
  -H "Authorization: Bearer $PRISM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse-1.1-r2v",
    "imageUrls": [
      "https://cdn.example.com/character/front.png",
      "https://cdn.example.com/character/side.png"
    ],
    "prompt": "A short studio walk cycle with consistent character identity",
    "generateAudio": true,
    "refAudioUrl": "https://cdn.example.com/audio/reference-voice.wav"
  }'
```

## Video edit

For video edit models, send `refVideoUrl`. A prompt is useful for edit intent, but the media input is the required anchor.

```bash theme={null}
curl -sS "$PRISM_BASE_URL/video/generations" \
  -H "Authorization: Bearer $PRISM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse-1.1-video-edit",
    "refVideoUrl": "https://cdn.example.com/source/product-demo.mp4",
    "prompt": "Replace the background with a bright product launch stage while preserving the subject motion",
    "generateAudio": false
  }'
```

## Poll a video job

```bash theme={null}
curl -sS "$PRISM_BASE_URL/video/generations/$JOB_ID" \
  -H "Authorization: Bearer $PRISM_API_KEY"
```

## Operational notes

* Video and image model IDs must appear in `GET /v1/models` for the calling key.
* Media inputs are URL-only today. Prism does not accept a file upload in these
  request bodies. Host the input on an HTTPS URL that the selected runtime can
  fetch, and avoid long-lived public access where a short-lived URL is possible.
* If the selected model is draft, not visible, not configured for the requested modality, or missing provider credentials, the Facade returns a catalog or runtime configuration error.

See [Errors](/errors) for retry behavior and [Billing and
trials](/billing-and-trials) for trial restrictions.
