Recoup

Get started with Recoup.

API REFERENCE

Generate image (GET)

On this page
GET/api/image/generate

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.

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

Authentication

See the authentication guide for API key and account access requirements.

Request

cURL
curl --request GET \
  --url 'https://api.recoupable.dev/api/image/generate?prompt=YOUR_PROMPT&account_id=YOUR_ACCOUNT_ID' \
  --header 'x-api-key: YOUR_API_KEY'

Replace the YOUR_ placeholders with your values. Required query parameters are included; optional parameters are listed below.

Try it

Fill in the fields, send the request from your browser, and read the live response. The curl below updates as you type.

Kept in this browser tab only and cleared when it closes.

cURL for this request
curl --request GET \
  --url 'https://api.recoupable.dev/api/image/generate'

Parameters

Query parameters

promptstringrequired

Text description of the image you want to generate

account_idstringrequired

The unique identifier of the account generating the image

Responses

200Image generated successfully

application/json

usageobjectrequired

Token usage information for the image generation

Properties for usage
promptTokensinteger

Number of tokens used in the prompt

completionTokensinteger

Number of tokens used in the completion (typically 0 for image generation)

totalTokensinteger

Total tokens used

imageUrlstring | nullrequired

Public Supabase Storage URL of the stored image, or null when storage fails. It is not a signed private URL.

format: uri

arweaveResultnullrequired

Deprecated compatibility field. Always null: new uploads do not create Arweave transactions.

momentany ofrequired

Best-effort In Process result, or null when no moment was created. A stored image does not guarantee moment creation.

Properties for moment
anyOf · InProcessMoment 1

In Process moment metadata for provenance and ownership tracking

contractAddressstring

Smart contract address for the moment

tokenIdstring

Token ID of the minted moment

hashstring

Transaction hash of the moment mint

chainIdinteger

Chain ID (e.g., 8453 for Base)

anyOf · null 2

null

imageobjectrequired

Generated image data from the model. Storage outcome is reported separately by imageUrl and uploadError.

Properties for image
base64string

Image file as a base64 encoded string

uint8Arrayarray<integer>

Image file as a Uint8Array (represented as array of numbers in JSON)

Item properties for uint8Array

integer

mediaTypestring

The IANA media type of the file (e.g., 'image/png', 'image/jpeg')

uploadErrorstring

Present if storing the generated image fails. A partial result can still have HTTP status 200.

Example: "Could not store generated image"

arweaveErrorstring

Deprecated alias of uploadError, present with the same value when storage fails. It does not identify an Arweave operation.

400Bad request - missing required parameters or invalid input

application/json

errorstring

Error message describing what went wrong

Full specification

Download the OpenAPI file for complete schemas, constraints, and examples.

Download content.json
View operation source
json
{
  "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"
          }
        }
      }
    }
  }
}