File size: 8,718 Bytes
5ef6e9d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | openapi: 3.1.0
info:
# Do not change the title, if the title changes, the import paths will be broken
title: Api
version: 0.1.0
description: API specification
servers:
- url: /api
description: Base API path
tags:
- name: health
description: Health operations
- name: images
description: Image generation operations
- name: config
description: Configuration operations
paths:
/healthz:
get:
operationId: healthCheck
tags: [health]
summary: Health check
description: Returns server health status
responses:
"200":
description: Healthy
content:
application/json:
schema:
$ref: "#/components/schemas/HealthStatus"
/config/token:
get:
operationId: getConfigToken
tags: [config]
summary: Get API token status
description: Check if a Bearer token is configured
responses:
"200":
description: Token status
content:
application/json:
schema:
$ref: "#/components/schemas/TokenStatusResponse"
post:
operationId: setConfigToken
tags: [config]
summary: Set API token
description: Save the Bearer token for geminigen.ai API
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/SetTokenBody"
responses:
"200":
description: Token saved
content:
application/json:
schema:
$ref: "#/components/schemas/SuccessResponse"
delete:
operationId: deleteConfigToken
tags: [config]
summary: Delete API token
description: Remove the stored Bearer token
responses:
"200":
description: Token removed
content:
application/json:
schema:
$ref: "#/components/schemas/SuccessResponse"
/images/generate:
post:
operationId: generateImage
tags: [images]
summary: Generate image
description: Generate an image using AI based on a text prompt
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/GenerateImageBody"
responses:
"200":
description: Image generated successfully
content:
application/json:
schema:
$ref: "#/components/schemas/GenerateImageResponse"
"400":
description: Bad request
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"500":
description: Internal server error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/images/history:
get:
operationId: getImageHistory
tags: [images]
summary: Get image history
description: Retrieve the list of previously generated images
parameters:
- name: limit
in: query
schema:
type: integer
default: 20
- name: offset
in: query
schema:
type: integer
default: 0
responses:
"200":
description: List of generated images
content:
application/json:
schema:
$ref: "#/components/schemas/ImageHistoryResponse"
/images/{id}:
delete:
operationId: deleteImage
tags: [images]
summary: Delete image
description: Delete a generated image from history
parameters:
- name: id
in: path
required: true
schema:
type: integer
responses:
"200":
description: Image deleted successfully
content:
application/json:
schema:
$ref: "#/components/schemas/SuccessResponse"
"404":
description: Image not found
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
components:
schemas:
TokenStatusResponse:
type: object
properties:
configured:
type: boolean
token:
type: string
nullable: true
required:
- configured
SetTokenBody:
type: object
properties:
token:
type: string
required:
- token
HealthStatus:
type: object
properties:
status:
type: string
required:
- status
GenerateImageBody:
type: object
properties:
prompt:
type: string
description: Text description for image generation
style:
type: string
description: Style of image to generate
enum: [none, realistic, anime, artistic, cartoon, sketch, oil_painting, watercolor, digital_art]
default: realistic
aspectRatio:
type: string
description: Aspect ratio for the image
enum: ["1:1", "16:9", "9:16", "4:3", "3:4", "2:3", "3:2"]
default: "1:1"
model:
type: string
description: AI model to use
enum: [grok, meta, imagen-pro, imagen-4, imagen-flash, nano-banana-pro, nano-banana-2]
default: grok
resolution:
type: string
description: Output resolution for supported models (Nano Banana Pro / Nano Banana 2)
enum: ["1K", "2K", "4K"]
referenceImageBase64:
type: string
description: Base64-encoded reference image for image-to-image generation (optional)
referenceImageMime:
type: string
description: MIME type of the reference image (e.g. image/jpeg)
isPrivate:
type: boolean
description: Whether this image should be private (only visible to the creator)
default: false
required:
- prompt
ApiDebugInfo:
type: object
properties:
requestUrl:
type: string
requestMethod:
type: string
requestHeaders:
type: object
additionalProperties:
type: string
requestBody:
type: object
responseStatus:
type: integer
responseBody:
type: object
durationMs:
type: number
usedFallback:
type: boolean
fallbackReason:
type: string
required:
- requestUrl
- requestMethod
- requestHeaders
- requestBody
- responseStatus
- responseBody
- durationMs
- usedFallback
GenerateImageResponse:
type: object
properties:
id:
type: integer
imageUrl:
type: string
prompt:
type: string
style:
type: string
aspectRatio:
type: string
model:
type: string
createdAt:
type: string
format: date-time
apiDebug:
$ref: "#/components/schemas/ApiDebugInfo"
required:
- id
- imageUrl
- prompt
- style
- aspectRatio
- model
- createdAt
- apiDebug
ImageRecord:
type: object
properties:
id:
type: integer
imageUrl:
type: string
prompt:
type: string
style:
type: string
aspectRatio:
type: string
model:
type: string
isPrivate:
type: boolean
userId:
type: integer
nullable: true
createdAt:
type: string
format: date-time
required:
- id
- imageUrl
- prompt
- style
- aspectRatio
- model
- isPrivate
- createdAt
ImageHistoryResponse:
type: object
properties:
images:
type: array
items:
$ref: "#/components/schemas/ImageRecord"
total:
type: integer
required:
- images
- total
SuccessResponse:
type: object
properties:
success:
type: boolean
message:
type: string
required:
- success
ErrorResponse:
type: object
properties:
error:
type: string
message:
type: string
required:
- error
- message
|