curl --request POST \
--url https://api.tikway.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gemini-3-pro-image",
"prompt": "Generate a photorealistic red apple on a rustic wooden table.",
"size": "1:1",
"quality": "standard"
}
'import requests
url = "https://api.tikway.ai/v1/images/generations"
payload = {
"model": "gemini-3-pro-image",
"prompt": "Generate a photorealistic red apple on a rustic wooden table.",
"size": "1:1",
"quality": "standard"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gemini-3-pro-image',
prompt: 'Generate a photorealistic red apple on a rustic wooden table.',
size: '1:1',
quality: 'standard'
})
};
fetch('https://api.tikway.ai/v1/images/generations', 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.tikway.ai/v1/images/generations",
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([
'model' => 'gemini-3-pro-image',
'prompt' => 'Generate a photorealistic red apple on a rustic wooden table.',
'size' => '1:1',
'quality' => 'standard'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.tikway.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"gemini-3-pro-image\",\n \"prompt\": \"Generate a photorealistic red apple on a rustic wooden table.\",\n \"size\": \"1:1\",\n \"quality\": \"standard\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.tikway.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gemini-3-pro-image\",\n \"prompt\": \"Generate a photorealistic red apple on a rustic wooden table.\",\n \"size\": \"1:1\",\n \"quality\": \"standard\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tikway.ai/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gemini-3-pro-image\",\n \"prompt\": \"Generate a photorealistic red apple on a rustic wooden table.\",\n \"size\": \"1:1\",\n \"quality\": \"standard\"\n}"
response = http.request(request)
puts response.read_body{
"created": 1713833628,
"data": [
{
"b64_json": "..."
}
],
"usage": {
"total_tokens": 100,
"input_tokens": 50,
"output_tokens": 50,
"input_tokens_details": {
"text_tokens": 10,
"image_tokens": 40
}
}
}Image generation
Unified OpenAI compatible portal. size represents the aspect ratio, and quality maps to Gemini’s image resolution.
| Model | Output resolution | Reference image | Search and thinking |
|---|---|---|---|
gemini-3.1-flash-image | 512px, 1K, 2K, 4K; supports 1:4/4:1/1:8/8:1 extreme ratios | Up to 14 images (max 10 objects + 4 characters) | google_search, image_search, thinking_level |
gemini-3-pro-image | 1K, 2K, 4K | Up to 14 images (up to 6 objects + 5 characters + 3 styles) | google_search, thinking_level; image search is not supported |
gemini-2.5-flash-image | Fixed 1K | Recommended maximum 3 images | Does not support Google Search, image search and thinking |
This entry does not accept native generationConfig, aspect_ratio or image_size, please use size and quality.
curl --request POST \
--url https://api.tikway.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gemini-3-pro-image",
"prompt": "Generate a photorealistic red apple on a rustic wooden table.",
"size": "1:1",
"quality": "standard"
}
'import requests
url = "https://api.tikway.ai/v1/images/generations"
payload = {
"model": "gemini-3-pro-image",
"prompt": "Generate a photorealistic red apple on a rustic wooden table.",
"size": "1:1",
"quality": "standard"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gemini-3-pro-image',
prompt: 'Generate a photorealistic red apple on a rustic wooden table.',
size: '1:1',
quality: 'standard'
})
};
fetch('https://api.tikway.ai/v1/images/generations', 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.tikway.ai/v1/images/generations",
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([
'model' => 'gemini-3-pro-image',
'prompt' => 'Generate a photorealistic red apple on a rustic wooden table.',
'size' => '1:1',
'quality' => 'standard'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.tikway.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"gemini-3-pro-image\",\n \"prompt\": \"Generate a photorealistic red apple on a rustic wooden table.\",\n \"size\": \"1:1\",\n \"quality\": \"standard\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.tikway.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gemini-3-pro-image\",\n \"prompt\": \"Generate a photorealistic red apple on a rustic wooden table.\",\n \"size\": \"1:1\",\n \"quality\": \"standard\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tikway.ai/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gemini-3-pro-image\",\n \"prompt\": \"Generate a photorealistic red apple on a rustic wooden table.\",\n \"size\": \"1:1\",\n \"quality\": \"standard\"\n}"
response = http.request(request)
puts response.read_body{
"created": 1713833628,
"data": [
{
"b64_json": "..."
}
],
"usage": {
"total_tokens": 100,
"input_tokens": 50,
"output_tokens": 50,
"input_tokens_details": {
"text_tokens": 10,
"image_tokens": 40
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Required. Gemini picture model. See the interface description for the resolution, search, thinking and reference map limitations of different models.
gemini-3.1-flash-image, gemini-3-pro-image, gemini-2.5-flash-image 1Required. Generate prompt words for pictures.
1 - 32000Optional. Reference image array; at least 1 image is used for image editing. URL/data URL string or object containing image_url can be passed; file_id is not supported. See the interface description for the upper limit of the model.
1 - 14 elementsOutput aspect ratio. The gateway reduces and maps this field to Gemini aspectRatio; it is not a pixel dimension. Extreme ratios 1:4, 4:1, 1:8, 8:1 are only supported by gemini-3.1-flash-image.
1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9 Output resolution mapping: low→512px, standard→1K, medium→2K, high/hd→4K, auto/omitted→not specified. gemini-2.5-flash-image only supports 1K.
standard, hd, low, medium, high, auto Gemini native extension, whether to enable Google Search grounding; only available for models that support this capability.
Gemini native extension, whether to enable image search grounding; only available for models that support this capability.
Gemini native extension, model thinking intensity; only models that support this capability are available.
Minimal, High Fixed returning Base64 image so that the response conforms to the Response Schema of this interface.
b64_json, url Response
Unix timestamp in seconds when the image was created.
Generate a list of results.
Hide child attributes
Hide child attributes
Base64 encoded image data. GPT Image is returned by default; DALL·E is returned when response_format=b64_json.
DALL·E 3 Revision prompt words actually used.
Generate image URL. Returned only when DALL·E and response_format=url; valid for 60 minutes.
The actual background settings used.
transparent, opaque Actual output image format.
png, webp, jpeg Actual build quality.
low, medium, high The actual resulting image size.
The token usage of the GPT Image model.
Hide child attributes
Hide child attributes
Number of tokens for input (text and image).
Output the number of tokens.
The total number of input and output tokens.

