API Reference
Convert images to text
POST
/
v1
/
images
/
to-text
Convert images to text
curl --request POST \
--url https://api.synapsai.cloud/v1/images/to-text \
--header 'Content-Type: application/json' \
--data '
{
"inputs": "<string>",
"max_new_tokens": 512,
"generate_kwargs": {},
"timeout": 123
}
'import requests
url = "https://api.synapsai.cloud/v1/images/to-text"
payload = {
"inputs": "<string>",
"max_new_tokens": 512,
"generate_kwargs": {},
"timeout": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)[
{
"generated_text": "<string>"
}
]Body
application/json
Request to generate textual descriptions/captions for images.
Image(s) to caption (URL, base64, or binary). Required.
Maximum number of tokens to generate for each caption.
Optional extra generation arguments to control sampling/decoding.
Maximum time in seconds to wait for processing or fetching.
Response
200 - application/json
Generated text descriptions
⌘I
Convert images to text
curl --request POST \
--url https://api.synapsai.cloud/v1/images/to-text \
--header 'Content-Type: application/json' \
--data '
{
"inputs": "<string>",
"max_new_tokens": 512,
"generate_kwargs": {},
"timeout": 123
}
'import requests
url = "https://api.synapsai.cloud/v1/images/to-text"
payload = {
"inputs": "<string>",
"max_new_tokens": 512,
"generate_kwargs": {},
"timeout": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)[
{
"generated_text": "<string>"
}
]