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

# Generate a product

> Starts a job that generates one product from a prompt, in a `print` or `jewelry` category. When the job succeeds, `result.productId` is the product; read it with `products/get`. The job finishes when the product is built.

Takes only `requestId`, `prompt` and `categoryId`. Arcade chooses the options of the product:

- In a `jewelry` category, from your prompt. Name the options you want there; `categories/get` lists them.
- In a `print` category, on its own. To choose the options, a model, references or colors yourself, call `patterns/create`, then `products/create`.

A jewelry prompt is checked against the category before the job starts. A prompt that clearly does not fit returns `400`. A jewelry product cannot be edited afterwards: to change the piece, generate a new product.



## OpenAPI

````yaml /openapi.json post /products/generate
openapi: 3.1.1
info:
  title: Arcade API
  version: '1'
  description: >-
    Generate patterns and custom products from text prompts, and order them.
    Every request is a POST with a JSON body.
servers:
  - url: https://platform.arcade.ai/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Patterns
    description: Reusable print patterns you generate or upload.
  - name: Refine
    description: Edit, recolor, crop and extend patterns.
  - name: Jobs
    description: Long-running work.
  - name: References
    description: Images that guide generation.
  - name: Models
    description: The models that generate patterns.
  - name: Categories
    description: Product types and their options.
  - name: Products
    description: Products generated from a prompt or made from your patterns.
  - name: Checkouts
    description: Checkouts for ordering products.
  - name: Orders
    description: Your orders.
  - name: Feedback
    description: Reports about the API to Arcade.
paths:
  /products/generate:
    post:
      tags:
        - Products
      summary: Generate a product
      description: >-
        Starts a job that generates one product from a prompt, in a `print` or
        `jewelry` category. When the job succeeds, `result.productId` is the
        product; read it with `products/get`. The job finishes when the product
        is built.


        Takes only `requestId`, `prompt` and `categoryId`. Arcade chooses the
        options of the product:


        - In a `jewelry` category, from your prompt. Name the options you want
        there; `categories/get` lists them.

        - In a `print` category, on its own. To choose the options, a model,
        references or colors yourself, call `patterns/create`, then
        `products/create`.


        A jewelry prompt is checked against the category before the job starts.
        A prompt that clearly does not fit returns `400`. A jewelry product
        cannot be edited afterwards: to change the piece, generate a new
        product.
      operationId: products.generate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                requestId:
                  type: string
                  minLength: 1
                  maxLength: 128
                  description: >-
                    An ID you choose for this request, up to 128 characters.
                    Retrying with the same `requestId` and body returns the
                    original result.
                prompt:
                  type: string
                  minLength: 1
                  maxLength: 1000
                  description: >-
                    What the product should look like, up to 1000 characters. In
                    a `jewelry` category, name the options you want, such as the
                    metal.
                categoryId:
                  type: string
                  minLength: 1
                  description: The category to make the product in, from `categories/list`.
              required:
                - requestId
                - prompt
                - categoryId
              additionalProperties: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  jobId:
                    type: string
                    minLength: 1
                    description: The job's ID. Pass it to `jobs/get`.
                  kind:
                    enum:
                      - pattern
                      - product
                      - download
                    type: string
                    description: >-
                      What the job makes. `pattern`: started by
                      `patterns/create` or a refine that returns a job.
                      `product`: started by `products/create` or
                      `products/generate`. `download`: started by an upscale in
                      Arcade Studio.
                  status:
                    enum:
                      - running
                      - succeeded
                      - failed
                    type: string
                    description: >-
                      A job starts as `running` and ends as `succeeded` or
                      `failed`.
                  result:
                    anyOf:
                      - anyOf:
                          - type: object
                            properties:
                              patternId:
                                type: string
                                minLength: 1
                                description: >-
                                  Opaque ID of one pattern: an immutable image.
                                  A refine makes a new pattern.
                            required:
                              - patternId
                          - type: object
                            properties:
                              productId:
                                type: string
                                minLength: 1
                                description: Opaque product ID
                            required:
                              - productId
                          - type: object
                            properties:
                              downloadUrl:
                                type: string
                                format: uri
                                description: Short-lived; read the job again to renew
                              expiresAt:
                                type: string
                                format: date-time
                                description: The URL works at least until this time
                            required:
                              - downloadUrl
                              - expiresAt
                      - type: 'null'
                    description: >-
                      What the job made, once it succeeded. Null while the job
                      is running and when it failed. Also null on a succeeded
                      job when a deformity fix found nothing to repair, or when
                      the pattern has since been deleted.
                  error:
                    anyOf:
                      - type: object
                        properties:
                          message:
                            type: string
                            description: What went wrong.
                          reason:
                            const: insufficient_credits
                            description: >-
                              Present when the job failed because the account
                              ran out of credits. Add credits or a plan, then
                              send the request again with a new `requestId`.
                        required:
                          - message
                      - type: 'null'
                    description: Why the job failed. Null unless the job failed.
                  createdAt:
                    type: string
                    format: date-time
                    description: >-
                      When the job started. For a product whose build was not
                      recorded, when the product was created.
                  completedAt:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: 'null'
                    description: >-
                      When the job finished. Null while the job is running, and
                      for a failed product job.
                required:
                  - jobId
                  - kind
                  - status
                  - result
                  - error
                  - createdAt
                  - completedAt
                description: A product job; its result names the product once built
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: An API key from Settings → API keys in Arcade Studio.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.