Visualize Image
curl --request POST \
--url https://api.img-processing.com/v1/images/{image_id}/visualize \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"prompt": "What is in this image?",
"model": "uform-gen"
}
'import requests
url = "https://api.img-processing.com/v1/images/{image_id}/visualize"
payload = {
"prompt": "What is in this image?",
"model": "uform-gen"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({prompt: 'What is in this image?', model: 'uform-gen'})
};
fetch('https://api.img-processing.com/v1/images/{image_id}/visualize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.img-processing.com/v1/images/{image_id}/visualize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'What is in this image?',
'model' => 'uform-gen'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.img-processing.com/v1/images/{image_id}/visualize"
payload := strings.NewReader("{\n \"prompt\": \"What is in this image?\",\n \"model\": \"uform-gen\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.img-processing.com/v1/images/{image_id}/visualize")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"What is in this image?\",\n \"model\": \"uform-gen\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.img-processing.com/v1/images/{image_id}/visualize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"What is in this image?\",\n \"model\": \"uform-gen\"\n}"
response = http.request(request)
puts response.read_body{
"response": "A beautiful sunset over the mountains with a clear sky and vibrant colors."
}{
"type": "https://docs.img-processing.com/errors/unauthorized",
"error": "Unauthorized",
"status": 401,
"message": "API key is required."
}{
"type": "https://docs.img-processing.com/errors/forbidden",
"error": "Forbidden",
"status": 403,
"message": "You are not allowed to access this image."
}{
"type": "https://docs.img-processing.com/errors/validation-error",
"error": "Validation Error",
"status": 422,
"errors": [
"{field or param} {error message}"
]
}{
"type": "https://docs.img-processing.com/errors/too-many-requests",
"error": "Too Many Requests",
"status": 429,
"message": "Rate limit exceeded. Try again later."
}{
"type": "https://docs.img-processing.com/errors/internal-error",
"error": "Internal Error",
"status": 500,
"message": "An unexpected error occurred. Please try again later. If the problem persists, contact support."
}Analysis Endpoints
Visualize Image
Answer a prompt based on the content of an image.
POST
/
v1
/
images
/
{image_id}
/
visualize
Visualize Image
curl --request POST \
--url https://api.img-processing.com/v1/images/{image_id}/visualize \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"prompt": "What is in this image?",
"model": "uform-gen"
}
'import requests
url = "https://api.img-processing.com/v1/images/{image_id}/visualize"
payload = {
"prompt": "What is in this image?",
"model": "uform-gen"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({prompt: 'What is in this image?', model: 'uform-gen'})
};
fetch('https://api.img-processing.com/v1/images/{image_id}/visualize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.img-processing.com/v1/images/{image_id}/visualize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'What is in this image?',
'model' => 'uform-gen'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.img-processing.com/v1/images/{image_id}/visualize"
payload := strings.NewReader("{\n \"prompt\": \"What is in this image?\",\n \"model\": \"uform-gen\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.img-processing.com/v1/images/{image_id}/visualize")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"What is in this image?\",\n \"model\": \"uform-gen\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.img-processing.com/v1/images/{image_id}/visualize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"What is in this image?\",\n \"model\": \"uform-gen\"\n}"
response = http.request(request)
puts response.read_body{
"response": "A beautiful sunset over the mountains with a clear sky and vibrant colors."
}{
"type": "https://docs.img-processing.com/errors/unauthorized",
"error": "Unauthorized",
"status": 401,
"message": "API key is required."
}{
"type": "https://docs.img-processing.com/errors/forbidden",
"error": "Forbidden",
"status": 403,
"message": "You are not allowed to access this image."
}{
"type": "https://docs.img-processing.com/errors/validation-error",
"error": "Validation Error",
"status": 422,
"errors": [
"{field or param} {error message}"
]
}{
"type": "https://docs.img-processing.com/errors/too-many-requests",
"error": "Too Many Requests",
"status": 429,
"message": "Rate limit exceeded. Try again later."
}{
"type": "https://docs.img-processing.com/errors/internal-error",
"error": "Internal Error",
"status": 500,
"message": "An unexpected error occurred. Please try again later. If the problem persists, contact support."
}Description
This endpoint returns a response based on the content of an image and a base prompt. The prompt can be a question, statement, or any text that you want to ask about the image. The API will analyze the content of the image and generate a response based on the prompt using a pre-trained model. Right now there are two models available for this endpoint:- Uform-Gen: UForm-Gen is a small generative vision-language model primarily designed for Image Captioning and Visual Question Answering.
- Llava: LLaVA is a large multimodal model that can generate text based on images and text prompts.
- Gemini: Gemini is a multimodal model with advanced capabilities for understanding and generating text based on images.
Test images may return accurate results due the
test watermarks applied to them. If you want to get
better results, please use live images. If you just want to test this feature, contact support to temporarily
upgrade your account.Authorizations
API Key for authentication
Path Parameters
The unique identifier of the image. This identifier is used to reference the image in subsequent requests.
Body
application/json
The prompt to answer based on the content of the image. This is a natural language question or instruction that the model will respond to.
Required string length:
1 - 1000The model to use for the visualization. Supported models are uform-gen, llava, and gemini. If not provided, the default model will be used.
Available options:
uform-gen, llava, gemini Response
The API will return the Image object in the response body.
Response object for the visualize endpoint.
The response from the AI model. This is the description of the image based on the prompt provided.

