API REFERENCE
Generate Image
On this page
/api/image/generateGenerate high-quality images using AI models. Images are automatically stored on Arweave and include In Process moment metadata for provenance and ownership tracking.
Authentication
See the authentication guide for API key and account access requirements.
Request
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.
Parameters
Query parameters
promptstringrequiredText description of the image you want to generate
account_idstringrequiredThe unique identifier of the account generating the image
Responses
200Image generated successfully+
application/json
imagesarray<GeneratedImage>Array of generated image objects
Item properties for images
base64stringImage 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
mediaTypestringThe IANA media type of the file (e.g., 'image/png', 'image/jpeg')
warningsarray<string>Array of warning messages, if any
Item properties for warnings
string
responsesarray<ImageResponseMeta>Array of response metadata from the AI provider
Item properties for responses
finishReasonstringReason the generation finished (e.g., 'stop')
providerMetadataobjectMetadata from the AI provider about the generation
Properties for providerMetadata
modelstringThe AI model used for generation (e.g., 'dall-e-3', 'gpt-image-1')
sizestringThe size of the generated image (e.g., '1024x1024')
usageobjectToken usage information for the image generation
Properties for usage
promptTokensintegerNumber of tokens used in the prompt
completionTokensintegerNumber of tokens used in the completion (typically 0 for image generation)
totalTokensintegerTotal tokens used
imageUrlstringPermanent Arweave URL where the image is stored
arweaveResultobjectArweave transaction object for the stored image
Properties for arweaveResult
idstringUnique identifier for the Arweave transaction
last_txstringLast transaction reference
ownerstringOwner address of the transaction
tagsarray<object>Tags associated with the transaction
Item properties for tags
object
targetstringTarget address (empty for data transactions)
quantitystringAmount transferred (typically '0' for data transactions)
datastringTransaction data (may be empty in response)
rewardstringMining reward for the transaction
signaturestringTransaction signature
formatintegerTransaction format version
momentobjectIn Process moment metadata for provenance and ownership tracking
Properties for moment
contractAddressstringSmart contract address for the moment
tokenIdstringToken ID of the minted moment
hashstringTransaction hash of the moment mint
chainIdintegerChain ID (e.g., 8453 for Base)
400Bad request - missing required parameters or invalid input+
application/json
errorstringError message describing what went wrong
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download content.jsonView operation source
{
"description": "Generate high-quality images using AI models. Images are automatically stored on Arweave and include In Process moment metadata for provenance and ownership tracking.",
"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"
}
}
}
}
}
}