> ## 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.

# Virtual try-on

> Dress a person in one to four items with V6.

Send a person photo and one to four garment references. The defaults are **V6**, standard quality, and **one output image**. V6 is available to all Studio API accounts with the required plan and credits.

## Choose your inputs

There are two independent choices:

1. **Person photo:** send `person_image_url` for a direct image URL, or `person_image_id` for an [uploaded image](/api-reference/images/upload).
2. **Garments:** send one array: `outfit_image_urls` for direct image URLs, `outfit_image_ids` for uploaded images, or `outfit_asset_ids` for [saved products](/api-reference/assets-workflow).

You can combine any person source with any garment source. For example, a person URL works with saved product IDs. Use exactly one person field and one garment array per request.

## Request examples

Replace the example URLs or IDs with your own references. Each array entry is one garment; `num_images` controls how many output images to generate.

<Tabs sync={false}>
  <Tab title="Single item">
    One person and one garment, using direct image URLs.

    ```json theme={null}
    {
      "person_image_url": "https://your-cdn.example/person.jpg",
      "outfit_image_urls": ["https://your-cdn.example/shirt.jpg"]
    }
    ```

    [Run the single-item example →](/api-reference/try-on/single-item)
  </Tab>

  <Tab title="Multiple items">
    One output showing all three garments. Add up to four different items with V6.

    ```json theme={null}
    {
      "person_image_url": "https://your-cdn.example/person.jpg",
      "outfit_image_urls": [
        "https://your-cdn.example/shirt.jpg",
        "https://your-cdn.example/trousers.jpg",
        "https://your-cdn.example/jacket.jpg"
      ],
      "num_images": 1
    }
    ```

    [Build a complete outfit →](/api-reference/try-on/multiple-items)
  </Tab>

  <Tab title="Saved products">
    An uploaded person photo and two saved product assets. Keep multiple photos of the same product inside one asset.

    ```json theme={null}
    {
      "person_image_id": "11111111-1111-4111-8111-111111111111",
      "outfit_asset_ids": [
        "22222222-2222-4222-8222-222222222222",
        "33333333-3333-4333-8333-333333333333"
      ]
    }
    ```

    [Prepare your references →](/api-reference/try-on/inputs)
  </Tab>
</Tabs>

## Submit and retrieve the result

A successful request returns HTTP `202` with a `jobs` array. Save each `id`, then [get the job](/api-reference/jobs/get) until it finishes. Read the completed media from `result.url` and its reusable ID from `result.id`. Use an [Idempotency-Key](/api-reference/errors) when submitting work that may be retried.

The **Body** reference below shows the required fields for each combination of person and garment sources.


## OpenAPI

````yaml api-reference/openapi.json POST /v1/images/virtual-try-on
openapi: 3.0.3
info:
  title: bitStudio public API
  version: 1.0.0
  description: >-
    Public v1 operations. Create work with a focused endpoint, then retrieve its
    job. Media IDs are opaque; API clients do not manage Studio versions. New
    response fields may be added; clients should ignore fields they do not
    recognize.
servers:
  - url: https://api.bitstudio.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/images/virtual-try-on:
    post:
      summary: Virtual try-on
      operationId: virtual-try-on
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 128
            pattern: ^[!-~]+$
          description: >-
            Use a unique key for each intended creation. Retry the same method,
            path and JSON with the same key to replay its response for 24 hours
            after completion. Conflicting requests and unfinished or uncertain
            outcomes return 409. An uncertain receipt is never automatically
            rerun.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicTryOnRequest'
            example:
              person_image_id: 11111111-1111-4111-8111-111111111111
              outfit_image_ids:
                - 22222222-2222-4222-8222-222222222222
      responses:
        '202':
          description: Accepted; poll each job.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Submission'
              example:
                jobs:
                  - id: 11111111-1111-4111-8111-111111111111
                    status: pending
                    task: virtual-try-on
                    created_at: '2026-09-15T12:00:00Z'
                    result: null
                    error: null
                    credits_used: 1
        default:
          description: Request failed; inspect code and message.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PublicTryOnRequest:
      type: object
      additionalProperties: false
      properties:
        model:
          type: string
          default: v6
          description: >-
            Defaults to v6, available to all Studio API accounts with the
            required plan and credits. Older v4/v4x/v5 models can require
            account access.
          enum:
            - v6
            - v1
            - nano-banana
            - nano-banana-pro
            - nano-banana-2
            - v4
            - v4x
            - v5
        resolution:
          type: string
          enum:
            - standard
            - high
          default: standard
          description: Output quality; dimensions depend on the model and aspect ratio.
        num_images:
          type: integer
          description: Number of outputs. Defaults to 1. Account limits still apply.
          minimum: 1
          maximum: 8
          example: 1
          default: 1
        seed:
          type: integer
          description: Optional seed; it does not guarantee identical results.
        aspect_ratio:
          type: string
          description: Optional model-dependent output ratio.
        person_image_id:
          type: string
          description: Uploaded person image. Supply this or person_image_url.
          format: uuid
        person_image_url:
          type: string
          description: Direct URL of a person photo.
          format: uri
        outfit_image_ids:
          type: array
          items:
            type: string
            description: Resource ID.
            format: uuid
          description: >-
            Garment references. Choose one outfit source array per request. V6
            supports up to four items; other models may accept fewer.
          maxItems: 4
          minItems: 1
        outfit_image_urls:
          type: array
          items:
            type: string
            description: ''
            format: uri
          description: >-
            Garment references. Choose one outfit source array per request. V6
            supports up to four items; other models may accept fewer.
          maxItems: 4
          minItems: 1
        outfit_asset_ids:
          type: array
          items:
            type: string
            description: Resource ID.
            format: uuid
          description: >-
            Garment references. Choose one outfit source array per request. V6
            supports up to four items; other models may accept fewer.
          maxItems: 4
          minItems: 1
        prompt:
          type: string
          description: Optional styling instructions.
        style:
          type: string
          description: Optional style directions.
        asset_ids:
          type: array
          items:
            type: string
          description: >-
            Additional reusable reference asset IDs. Supported types depend on
            the operation.
        speed:
          type: string
          description: >-
            V6 accepts fast (the default processing mode); choose resolution for
            quality. Other models have their own speed options.
          example: fast
      oneOf:
        - title: Uploaded person + garment images
          required:
            - person_image_id
            - outfit_image_ids
        - title: Uploaded person + saved products
          required:
            - person_image_id
            - outfit_asset_ids
        - title: Uploaded person + garment URLs
          required:
            - person_image_id
            - outfit_image_urls
        - title: Person URL + garment images
          required:
            - person_image_url
            - outfit_image_ids
        - title: Person URL + saved products
          required:
            - person_image_url
            - outfit_asset_ids
        - title: Person URL + garment URLs
          required:
            - person_image_url
            - outfit_image_urls
    Submission:
      type: object
      required:
        - jobs
      properties:
        jobs:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Job'
    Error:
      type: object
      required:
        - code
        - message
        - request_id
      properties:
        code:
          type: string
        message:
          type: string
        request_id:
          type: string
          format: uuid
        error:
          type: string
          description: Compatibility error description.
        cta:
          type: boolean
          description: Account action is required.
        next_action:
          type: string
    Job:
      type: object
      required:
        - id
        - status
        - task
        - created_at
        - result
        - error
        - credits_used
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - pending
            - generating
            - completed
            - failed
            - policy_blocked
        task:
          type: string
          nullable: true
          description: >-
            Processing task. This may be more specific than the submitted
            operation.
        created_at:
          type: string
          format: date-time
        result:
          $ref: '#/components/schemas/JobResult'
        error:
          $ref: '#/components/schemas/JobError'
        credits_used:
          type: number
          minimum: 0
          description: >-
            Credits currently charged for this output, in display credits: 1
            means one Studio credit. Fractional amounts are preserved. A
            completed refund is reflected as 0 when polling. Creation and
            idempotency replay responses are snapshots; poll for the latest
            charge.
          example: 1.5
    JobResult:
      type: object
      nullable: true
      required:
        - image_id
        - url
        - width
        - height
        - id
        - type
      properties:
        image_id:
          type: string
          format: uuid
          description: Compatibility alias for id. Use id for new integrations.
        url:
          type: string
          format: uri
          description: Completed media URL.
        width:
          type: integer
          nullable: true
        height:
          type: integer
          nullable: true
        id:
          type: string
          format: uuid
          description: >-
            Opaque media ID. Pass an image result ID into the next image
            operation.
        type:
          type: string
          enum:
            - image
            - video
    JobError:
      type: object
      nullable: true
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: >-
            Safe failure classification. Handle unknown or new values with a
            general failure message.
        message:
          type: string
          description: Safe, readable failure description.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Create an API key in Studio → account menu → API Keys. Keep it on your
        server.

````