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

# Build a reusable reference library

> Save products, avatars, and presets as assets, then use their IDs in repeated generations.

Use assets when a product, person, or scene needs to appear in more than one request. An asset record holds metadata; its linked source images provide the visual references.

## Find a library avatar and preset

Set `include_public=true` to include shared library assets. Set `paginated=true` for an object response with pagination:

```bash theme={null}
curl --fail-with-body 'https://api.bitstudio.ai/assets?type=model&include_public=true&paginated=true&limit=20' \
  --header "Authorization: Bearer $BITSTUDIO_API_KEY"
```

Repeat with `type=preset` for scenes. Choose an asset by its `alias` and preview, then keep its `id`. When `page_info.has_next_page` is true, send `page_info.next_cursor` as the next `cursor`, keeping the same filters.

<Note>
  Without `paginated=true`, `GET /assets` returns a bare array. It also defaults to `type=model` when you omit the type. Do not parse both modes as the same response shape.
</Note>

## Save a product

### Create the asset record

```bash theme={null}
curl --fail-with-body 'https://api.bitstudio.ai/assets' \
  --header "Authorization: Bearer $BITSTUDIO_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"type":"outfit","alias":"Blue striped shirt","sku":"SHIRT-BLUE-01"}'
```

Keep the returned `id` as `OUTFIT_ASSET_ID`.

### Upload the references to that asset

```bash theme={null}
curl --fail-with-body "https://api.bitstudio.ai/assets/$OUTFIT_ASSET_ID/images" \
  --header "Authorization: Bearer $BITSTUDIO_API_KEY" \
  --form 'file=@./shirt-front.jpg' \
  --form 'type=virtual-try-on-outfit'
```

Repeat with the back and useful detail photos of the **same product and colorway**. Alternatively, [link an already-uploaded image](/api-reference/assets/link-image) with `POST /images/{id}/asset` and `{"asset_id":"OUTFIT_ASSET_ID"}`.

Read back your references with `GET /assets/{id}/images?for_training=true`. Omit the `for_training` filter to read the asset’s wider image collection. Public preset source photos may not be accessible even when you can use the preset for generation.

## Use the saved references

Substitute the IDs returned by your own requests:

```json theme={null}
{
  "asset_ids": ["AVATAR_ASSET_ID", "PRESET_ASSET_ID"],
  "outfit_asset_ids": ["OUTFIT_ASSET_ID"],
  "model_version": "nano-banana-2",
  "generate_mode": "presets",
  "resolution": "standard",
  "aspect_ratio": "3:4",
  "num_images": 1,
  "outfit_text": "Keep the shirt untucked, with the collar and cuffs visible.",
  "prompt": "Full-length front view, relaxed standing pose, soft shadows."
}
```

Send this body to [`POST /images/generate`](/api-reference/images/generate). It returns an array of jobs. Change the outfit asset for another product while keeping the same avatar, preset, and settings for a consistent series.

## Create your own avatar or preset

Create an asset with `type=model` for an avatar or `type=preset` for a visual setup. Give it a useful `alias` and `characteristics`. Upload its reference photos to `/assets/{id}/images` with `type=training`.

For a preset, use a class such as `human_studio`, `human_location`, `ghost_mannequin`, `flat_lay`, or `product_packshot`. You can [analyze one to three uploaded images](/api-reference/assets/analyze-preset) to obtain a suggested name, class, and prompt before saving the asset.

A `display_image` URL is only a thumbnail. You must also upload or link source images for the asset to act as a visual reference. Reference-based image models such as Nano Banana 2 can use these saved references without a separate model-training request.
