# Generate image (GET)

Source: https://docs.recoupable.dev/api-reference/image/generation

Generate an image using AI models. Generated images and related metadata use public Supabase Storage; anyone with a returned URL can read them without…

## GET /api/image/generate

Full OpenAPI specification: https://docs.recoupable.dev/spec/content.json

## Authentication

The supplied specification does not declare an OpenAPI security object for this operation. Its declared headers and parameters still apply. Consult the authentication guide and the full specification before calling it.

[Authentication guide](https://docs.recoupable.dev/authentication)

## Operation and referenced schemas

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Recoup API - Content",
    "description": "API documentation for the Recoup platform - an AI agent platform for the music industry",
    "license": {
      "name": "MIT"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.recoupable.dev"
    }
  ],
  "paths": {
    "/api/image/generate": {
      "get": {
        "operationId": "getImageGenerate",
        "description": "Generate an image using AI models. Generated images and related metadata use public Supabase Storage; anyone with a returned URL can read them without authentication. Existing Arweave URLs remain readable, but new image uploads do not create Arweave transactions. In Process moment creation remains best-effort.\n\nA 200 response may be partial: if storage fails after generation, imageUrl and moment are null and uploadError describes the failure. Check imageUrl before treating the result as a stored image. The deprecated arweaveResult field is always null; arweaveError is retained as an alias of uploadError when a storage error is present. This does not change private Files or release-pack source-audio storage.",
        "parameters": [
          {
            "name": "prompt",
            "in": "query",
            "description": "Text description of the image you want to generate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account_id",
            "in": "query",
            "description": "The unique identifier of the account generating the image",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageGenerationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing required parameters or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageGenerationErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ImageGenerationResponse": {
        "type": "object",
        "description": "Image-generation result and public-storage outcome. A 200 response can retain generated image data even when storage fails; imageUrl and moment may be null.",
        "properties": {
          "usage": {
            "$ref": "#/components/schemas/ImageUsage"
          },
          "imageUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Public Supabase Storage URL of the stored image, or null when storage fails. It is not a signed private URL."
          },
          "arweaveResult": {
            "type": "null",
            "deprecated": true,
            "description": "Deprecated compatibility field. Always null: new uploads do not create Arweave transactions."
          },
          "moment": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InProcessMoment"
              },
              {
                "type": "null"
              }
            ],
            "description": "Best-effort In Process result, or null when no moment was created. A stored image does not guarantee moment creation."
          },
          "image": {
            "$ref": "#/components/schemas/GeneratedImage",
            "description": "Generated image data from the model. Storage outcome is reported separately by imageUrl and uploadError."
          },
          "uploadError": {
            "type": "string",
            "description": "Present if storing the generated image fails. A partial result can still have HTTP status 200.",
            "example": "Could not store generated image"
          },
          "arweaveError": {
            "type": "string",
            "deprecated": true,
            "description": "Deprecated alias of uploadError, present with the same value when storage fails. It does not identify an Arweave operation."
          }
        },
        "required": [
          "image",
          "usage",
          "imageUrl",
          "arweaveResult",
          "moment"
        ]
      },
      "ImageGenerationErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Error message describing what went wrong"
          }
        }
      },
      "ImageUsage": {
        "type": "object",
        "description": "Token usage information for the image generation",
        "properties": {
          "promptTokens": {
            "type": "integer",
            "description": "Number of tokens used in the prompt"
          },
          "completionTokens": {
            "type": "integer",
            "description": "Number of tokens used in the completion (typically 0 for image generation)"
          },
          "totalTokens": {
            "type": "integer",
            "description": "Total tokens used"
          }
        }
      },
      "InProcessMoment": {
        "type": "object",
        "description": "In Process moment metadata for provenance and ownership tracking",
        "properties": {
          "contractAddress": {
            "type": "string",
            "description": "Smart contract address for the moment"
          },
          "tokenId": {
            "type": "string",
            "description": "Token ID of the minted moment"
          },
          "hash": {
            "type": "string",
            "description": "Transaction hash of the moment mint"
          },
          "chainId": {
            "type": "integer",
            "description": "Chain ID (e.g., 8453 for Base)"
          }
        }
      },
      "GeneratedImage": {
        "type": "object",
        "description": "A generated image file from the AI model",
        "properties": {
          "base64": {
            "type": "string",
            "description": "Image file as a base64 encoded string"
          },
          "uint8Array": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Image file as a Uint8Array (represented as array of numbers in JSON)"
          },
          "mediaType": {
            "type": "string",
            "description": "The IANA media type of the file (e.g., 'image/png', 'image/jpeg')"
          }
        }
      }
    }
  }
}
```
