Skip to main content
POST
/
generate
Transform image using AI template
curl --request POST \
  --url https://nanostudio.cloud/api/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "image": "<string>",
  "template": "<string>",
  "templateType": "expressions",
  "useCustomPrompt": true,
  "customPrompt": "<string>"
}
'
{
  "success": true,
  "data": {
    "id": "<string>",
    "url": "<string>",
    "templateUsed": "<string>",
    "processingTime": 123,
    "createdAt": "2023-11-07T05:31:56Z"
  },
  "usage": {
    "remainingCredits": 123,
    "resetDate": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
image
string
required

Base64 encoded image data

template
string
required

Template name from available templates

templateType
enum<string>
required

Template category

Available options:
expressions,
art-styles,
age-change,
backgrounds,
effects,
fashion,
hair-styles,
accessories,
seasonal,
professional,
fantasy,
animals,
food,
travel,
sports,
music,
utils,
virtual-tryon
useCustomPrompt
boolean

Use custom prompt instead of template

customPrompt
string

Custom prompt for AI generation

Response

Image transformed successfully

success
boolean
data
object
usage
object