| Endpoint | Model | Route | Latency |
|---|---|---|---|
| POST /api/vision | gemini-3.1-flash-lite | GMI Chat API json_object mode |
~3s |
| POST /api/generate | gemini-3.1-flash-image-preview | GMI Queue API submit + poll |
~15s |
| POST /api/identity-score | openai/gpt-4o | GMI Chat API json_object mode |
~5s |
| GET /api/download | Proxies GCS URLs — avoids CORS on storage.googleapis.com. Validates origin domain before fetching. | ||
response_format: json_object is reliable on both; Gemini wins on throughput per face crop when running N calls in parallel.14.6s per generation with a consistent 85/100 identity score; GPT-Image-2-Edit averaged 124s with variable 50–92 identity and frequent 60s+ outliers. Gemini wins on both throughput and identity stability. EDIT_MODEL env var swaps back to gpt-image-2-edit when max-fidelity matters more than speed./api/vision, keeping server payloads small and calls parallelizable.{
"model": "gemini-3.1-flash-lite",
"messages": [{
"role": "user",
"content": [
{ "type": "text",
"text": "<VISION_PROMPT>" },
{ "type": "image_url",
"image_url": {
"url": "data:image/jpeg;base64,…"
}}
]
}],
"response_format": {
"type": "json_object" },
"max_tokens": 200,
"temperature": 0.2
}
{
"model": "gemini-3.1-flash-image-preview",
"payload": {
"prompt": "OFFICIAL FIFA PRE-MATCH…",
"image": "data:image/jpeg;base64,…",
"size": "1024x1024",
"n": 1
}
}
// Poll response (success — Gemini)
{
"status": "completed",
"outcome": {
"candidates": [{
"content": { "parts": [{
"inlineData": {
"mimeType": "image/png",
"data": "<base64>"
}
}] }
}]
}
}
{
"apparent_age_band": "30s",
"apparent_gender_presentation":
"masculine",
"hair": "short black",
"facial_hair": "stubble",
"glasses": false,
"skin_tone": "medium",
"distinguishing": "prominent brow"
}
// Used to build the per-player
// guide section of the image
// generation prompt