POST /v1/images/generations
curl --request POST \
--url https://api.geekhub.mx/v1/images/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"n": 123,
"size": "<string>",
"quality": "<string>"
}
'import requests
url = "https://api.geekhub.mx/v1/images/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"n": 123,
"size": "<string>",
"quality": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
n: 123,
size: '<string>',
quality: '<string>'
})
};
fetch('https://api.geekhub.mx/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.geekhub.mx/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' => '<string>',
'prompt' => '<string>',
'n' => 123,
'size' => '<string>',
'quality' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.geekhub.mx/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"size\": \"<string>\",\n \"quality\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.geekhub.mx/v1/images/generations")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"size\": \"<string>\",\n \"quality\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.geekhub.mx/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"size\": \"<string>\",\n \"quality\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAPI Reference
POST /v1/images/generations
Image generation with any model from the catalog
POST
/
v1
/
images
/
generations
POST /v1/images/generations
curl --request POST \
--url https://api.geekhub.mx/v1/images/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"n": 123,
"size": "<string>",
"quality": "<string>"
}
'import requests
url = "https://api.geekhub.mx/v1/images/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"n": 123,
"size": "<string>",
"quality": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
n: 123,
size: '<string>',
quality: '<string>'
})
};
fetch('https://api.geekhub.mx/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.geekhub.mx/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' => '<string>',
'prompt' => '<string>',
'n' => 123,
'size' => '<string>',
'quality' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.geekhub.mx/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"size\": \"<string>\",\n \"quality\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.geekhub.mx/v1/images/generations")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"size\": \"<string>\",\n \"quality\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.geekhub.mx/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"size\": \"<string>\",\n \"quality\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyRequest body
string
required
The namespaced model ID, e.g.
fal/flux-1.1-pro.string
required
Image description. Maximum 4000 characters.
integer
default:"1"
Number of images to generate (1–8). Each image bills independently.
string
Desired size. What’s supported depends on the model:
- OpenAI gpt-image-1:
1024x1024,1536x1024,1024x1536 - OpenAI dall-e-3:
1024x1024,1792x1024,1024x1792 - fal/Recraft/Ideogram:
1024x1024,1024x768,768x1024, etc.
string
standard | hd for OpenAI. Other models ignore it.Response
{
"id": "req_xxx",
"object": "list",
"created": 1782412958,
"model": "fal/flux-1.1-pro",
"data": [
{
"url": "https://supabase.geekhub.mx/storage/v1/object/public/generated-images/<org>/<req>/0.jpg"
}
]
}
The URL is ours (Supabase Storage), not the provider’s. It’s persistent and doesn’t expire. Same security model as fal.media, Cloudinary, or unsigned S3: the URL includes 2 UUIDs (
org_id + request_id) making it unguessable.Examples
from openai import OpenAI
client = OpenAI(
base_url="https://api.geekhub.mx/v1",
api_key="ghub_sk_live_xxx",
)
response = client.images.generate(
model="fal/flux-1.1-pro",
prompt="An astronaut meditating on a cloud of tacos al pastor, cinematic style",
n=1,
size="1024x1024",
)
print(response.data[0].url)
response = client.images.generate(
model="openai/gpt-image-1",
prompt="An astronaut meditating on a cloud of tacos al pastor",
n=1,
size="1024x1024",
quality="hd",
)
response = client.images.generate(
model="google/gemini-2.5-flash-image",
prompt="An astronaut meditating on a cloud of tacos al pastor",
n=1,
)
curl -X POST https://api.geekhub.mx/v1/images/generations \
-H "Authorization: Bearer ghub_sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "fal/flux-1.1-pro",
"prompt": "An astronaut meditating on a cloud of tacos al pastor",
"n": 1,
"size": "1024x1024"
}'
Expected latency
| Model | P50 | P95 |
|---|---|---|
| DALL·E 3 | 8s | 20s |
| GPT Image 1 | 15s | 45s |
| Imagen 4 | 6s | 18s |
| Grok 2 Image | 10s | 30s |
| Flux 1.1 Pro | 7s | 25s |
| Flux 1.1 Pro Ultra | 12s | 40s |
| Recraft V3 | 8s | 28s |
| Ideogram V2 | 12s | 35s |
| SD 3.5 Large | 10s | 30s |
Costs
Each image is billed at the model price × 1.05 (markup) × FX MXN/USD. See Image models. Example: 1 image with Flux 1.1 Pro at FX $20 MXN/USD:$0.040 × 1.05 × 20 = $0.84 MXN per image
⌘I