Skip to main content
POST
/
image_editing
/
caption
Caption
curl --request POST \
  --url https://modelslab.com/api/v6/image_editing/caption \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "init_image": "<string>",
  "length": "normal",
  "base64": false,
  "webhook": "<string>",
  "track_id": 123
}'
{
  "status": "success",
  "generationTime": 123,
  "id": 123,
  "output": [
    "<string>"
  ],
  "proxy_links": [
    "<string>"
  ],
  "meta": {}
}
Caption Endpoint

Request

Make a POST request to below endpoint and pass the required parameters as a request body to the endpoint.
curl
--request POST 'https://modelslab.com/api/v6/image_editing/caption' \

Body

json
{
    "key":"your_api_key",
    "init_image":"https://i.pinimg.com/736x/6e/ab/48/6eab481a1ee8fcfaec32a316d2768a61.jpg",
    "length":"long",
    "base64": false,
    "webhook": null,
    "track_id": null
}

Body

application/json
key
string
required

Your API Key used for request authorization

init_image
string
required

Link the image you want your generate prompt from. Available formats: png, jpeg, jpg

length
enum<string>
default:normal

the length of the caption

Available options:
short,
normal,
long
base64
boolean
default:false

Set to true for base64 response

webhook
string<uri>

URL to receive POST API call when complete

track_id
integer

ID for webhook identification

Response

200 - application/json

Caption response

  • Option 1
  • Option 2
  • Option 3
status
enum<string>
Available options:
success
generationTime
number

Time taken to generate the image in seconds

id
integer

Unique identifier for the generation request

output
string<uri>[]

Array of generated image URLs

Array of proxy image URLs

meta
object

Metadata about the generation process