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

# Generate Studio Image

> Generate an AI Studio image with normalized params and optional model-specific raw passthrough.

Generate one image synchronously and return its hosted output URL.

## Body Parameters

<ParamField body="model_id" type="string" required>
  Image model ID from [Get Studio Models](/api-reference/get-studio-models).
</ParamField>

<ParamField body="prompt" type="string" required>
  Generation prompt.
</ParamField>

<ParamField body="image_urls" type="string[]">
  Optional input/reference image URLs. Genviral may mirror public reference URLs to its own CDN before handing them to the upstream model so image-edit requests are less sensitive to third-party hotlinking or fetch-policy issues.
</ParamField>

<ParamField body="params" type="object">
  Normalized image params. Supported keys: `aspect_ratio`, `resolution`, `output_format`, `size`, `max_images`, `sequential_image_generation`, `scale_factor`.
</ParamField>

<ParamField body="raw_params" type="object">
  Optional model-specific passthrough params.
</ParamField>

## Example

<RequestExample>
  ```json theme={null}
  {
    "model_id": "google/nano-banana",
    "prompt": "A cinematic beach sunset with palm trees",
    "params": {
      "aspect_ratio": "16:9",
      "output_format": "jpeg"
    }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "ok": true,
    "code": 201,
    "message": "Image generated",
    "data": {
      "file_id": "11111111-1111-1111-1111-111111111111",
      "output_url": "https://cdn.example.com/partner-api/workspaces/ws_1/studio/images/image-123.jpeg",
      "preview_url": "https://cdn.example.com/partner-api/workspaces/ws_1/studio/images/image-123.jpeg",
      "provider": "fal",
      "model_id": "google/nano-banana",
      "credits_used": 1
    }
  }
  ```
</ResponseExample>

## Error Responses

* `400 invalid_json` - request body is not valid JSON
* `401` - authentication failed (missing/invalid/revoked token)
* `402 subscription_required` - active Creator/Professional/Business plan required
* `403 tier_not_allowed` - Scheduler tier cannot use Partner API
* `403 insufficient_credits`
* `422 invalid_payload` (includes unsupported `model_id`)
* `422 invalid_input` - upstream model rejected the provided prompt/image combination
* `422 model_requires_image`
* `422 model_input_not_supported`
* `500 generation_failed`
