Viduq2 - Text To Image - gptproto
Elite viduq2 text to image. Create breathtaking, high-resolution AI photography and digital art from text.
POST
/
api
/
v3
/
vidu
/
viduq2
/
text-to-image
viduq2 (Text To Image)
curl --request POST \
--url https://gptproto.com/api/v3/vidu/viduq2/text-to-imageimport requests
url = "https://gptproto.com/api/v3/vidu/viduq2/text-to-image"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://gptproto.com/api/v3/vidu/viduq2/text-to-image', 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://gptproto.com/api/v3/vidu/viduq2/text-to-image",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://gptproto.com/api/v3/vidu/viduq2/text-to-image"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gptproto.com/api/v3/vidu/viduq2/text-to-image")
.asString();require 'uri'
require 'net/http'
url = URI("https://gptproto.com/api/v3/vidu/viduq2/text-to-image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyAuthentication
- Sign up for a GPTProto account at https://gptproto.com
- Navigate to the API Keys section in your dashboard
- Generate a new API key (sk-xxxxx)
- Copy and securely store your API key For authentication details, please refer to the Authentication section.
Initiate Request
curl --location 'https://gptproto.com/api/v3/vidu/viduq2/text-to-image' \
--header 'Authorization: GPTPROTO_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "a cat",
"aspect_ratio": "1:1",
"resolution": "2K",
"seed": 1
}'
const axios = require('axios');
let data = JSON.stringify({
"prompt": "a cat",
"aspect_ratio": "1:1",
"resolution": "2K",
"seed": 1
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://gptproto.com/api/v3/vidu/viduq2/text-to-image',
headers: {
'Authorization': 'GPTPROTO_API_KEY',
'Content-Type': 'application/json'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
import requests
import json
url = "https://gptproto.com/api/v3/vidu/viduq2/text-to-image"
payload = json.dumps({
"prompt": "a cat",
"aspect_ratio": "1:1",
"resolution": "2K",
"seed": 1
})
headers = {
'Authorization': 'GPTPROTO_API_KEY',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gptproto.com/api/v3/vidu/viduq2/text-to-image"
method := "POST"
payload := strings.NewReader(`{
"prompt": "a cat",
"aspect_ratio": "1:1",
"resolution": "2K",
"seed": 1
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "GPTPROTO_API_KEY")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Query Result
If the request that generated your content includes the parameterenable_sync_mode set to true (some models do not support this parameter, but you still need to query the result by id), you must call the Query Result endpoint to retrieve the final output.
curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \
-H "Authorization: GPTPROTO_API_KEY" \
-H "Content-Type: application/json"
import requests
import json
url = "https://gptproto.com/api/v3/predictions/{id}/result"
headers = {
"Authorization: GPTPROTO_API_KEY",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
result = response.json()
print(json.dumps(result, indent=2))
const url = "https://gptproto.com/api/v3/predictions/{id}/result";
const headers = {
"Authorization: GPTPROTO_API_KEY",
"Content-Type": "application/json"
};
fetch(url, {
method: "GET",
headers: headers
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://gptproto.com/api/v3/predictions/{id}/result"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "GPTPROTO_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
You can find it in either:
data.id– the unique identifier of the predictiondata.urls[0].get– a ready-to-use GET URL that already embeds the id
Response Example
Response Example
{
"data": {
"id": "abc",
"model": "model_name",
"outputs": [],
"urls": {
"get": "https://gptproto.com/api/v3/predictions/abc/result"
},
"status": "completed",
"error": null,
"executionTime": 0,
"timings": {
"inference": 0
},
"has_nsfw_contents": [],
"created_at": "2026-01-01 00:00:00"
},
"message": "success",
"code": 200
}
Parameters
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
prompt | string | ✅ Yes | - | - | The text prompt for generating the image. |
images | array | ✅ Yes | - | 1~7 items | The reference image to guide the generation. |
aspect_ratio | string | ❌ No | 1:1 | 1:116:99:164:33:421:92:33:2auto | The aspect ratio for the generated image. |
resolution | string | ❌ No | 1080p | 1080p2k4k | The output resolution quality: 1080p (1920x1080), 2K (2560x1440), or 4K (3840x2160). |
seed | integer | ❌ No | 1 | 1~2147483647 | The random seed to use for the generation. 1 means a random seed will be used. |
Error Codes
Common Error Codes
| Error Code | Error Name | Description |
|---|---|---|
| 401 | Unauthorized | API key is missing or invalid |
| 403 | Forbidden | Your API key doesn’t have permission to access this resource, or insufficient balance for the requested operation |
| 429 | Too Many Requests | You’ve exceeded your rate limit |
| 500 | Internal server error | An internal server error occurred |
| 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) |
⌘I

