---
title: "Generate a background image with Gemini."
method: POST
path: "/api/v1/backgrounds/generate"
tags: ["Backgrounds"]
---

# Generate a background image with Gemini.

`POST /api/v1/backgrounds/generate`

## Request

- Base URL: `https://api.avatarfactory.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.avatarfactory.io/api/v1/backgrounds/generate`
- Auth: one of:
  - API key in cookie `session`
  - HTTP bearer

## Request body

- GenerateBackgroundRequest
  - `category` string
  - `prompt` string, required

## Response `200`

OK

- GenerateBackgroundResponse
  - `filename` string, required
  - `name` string, required
  - `success` boolean, required

## Other responses

- `400`: Bad Request
- `422`: Unprocessable Entity
- `500`: Internal Server Error

---

[API](https://skmtc.dev/avatarfactory/apis/avatarfactory-api.md) · [All operations](https://skmtc.dev/avatarfactory/apis/avatarfactory-api/llms.txt) · [OpenAPI document](https://skmtc.dev/avatarfactory/apis/avatarfactory-api/revisions/66fc7aa3f296?raw)
