Genimix API

The Genimix API allows you to generate, upload, fetch, and delete images using your project's unique identifier and API key.

Each request requires a projectId, which you can find in the Settings or API Keys section of your dashboard. Authentication is done via a secret API key passed in the x-api-key header.

The API is currently in beta and subject to change. Please report any issues or feedback through email.

Available Models

Genimix supports multiple image generation models from different providers. You can choose a model by specifying the provider andmodelId in your request body.

All models are available in the Image Lab, but selection may be limited by your plan.

ProviderModelModel IDCost/Image
googleImagen 3.0imagen-3.0-generate-0026 Tokens
googleGemini 2.0 Flashgemini-2.0-flash-preview-image-generation8 Tokens
openaiDALL·E 3dall-e-316 Tokens
openaiDALL·E 2dall-e-24 Tokens
stabilityStable Image Ultra (coming soon)stable-image-ultraTBD
stabilityStable Image Core (coming soon)stable-image-coreTBD
stabilityStable Diffusion 3.5 (coming soon)stable-image-sd3TBD

Endpoints

All requests should be sent to the Genimix API host:https://api.genimix.dev. Each endpoint uses a versioned path prefix (/v1) and requires both a valid projectId and an API key provided via thex-api-key header.

All responses are JSON unless otherwise noted, and rate limits or quota usage may apply depending on your subscription plan.

Generate Image

PUT /v1/:projectId/generate/:imageId

Generates an image from a text prompt using a selected model and provider. The resulting image is stored under the specified project and image ID.

Request

Headers:

{
  "Content-Type": "application/json",
  "x-api-key": "your-api-key"
}

Body:

{
  "provider": "google",
  "modelId": "imagen-3.0-generate-002",
  "prompt": "A futuristic city skyline at sunset"
}

Provide a JSON payload with provider, modelId, and prompt fields.

Response

Headers:

{
  "Content-Type": "application/json"
}

Body:

{
  "success": true,
  "message": "Image generated successfully",
  "imageUrl": "https://api.genimix.dev/v1/:projectId/image/:imageId"
}

Returns the URL of the generated image.

Example

curl -X PUT https://api.genimix.dev/v1/my-project/generate/generated-id \
  -H "x-api-key: sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "google",
    "modelId": "imagen-3.0-generate-002",
    "prompt": "A futuristic city skyline at sunset"
  }'

Upload Image

PUT /v1/:projectId/image/:imageId

Uploads a binary image to the specified project and image ID. It replaces any existing image with the same image ID.

Request

Headers:

{
  "Content-Type": "image/png",
  "x-api-key": "your-api-key"
}

Body:

<binary image data>

Send raw binary image data with proper content-type. PNG is used in this example.

Response

Headers:

{
  "Content-Type": "application/json"
}

Body:

{
  "success": true,
  "message": "Image uploaded successfully",
  "imageUrl": "https://api.genimix.dev/v1/:projectId/image/:imageId"
}

Returns confirmation of successful upload and image URL.

Example

curl -X PUT https://api.genimix.dev/v1/my-project/image/abc123 \
  -H "x-api-key: sk_..." \
  -H "Content-Type: image/png" \
  --data-binary "@example.png"

Get Image

GET /v1/:projectId/image/:imageId

Fetches the image file associated with the given project and image ID.

Request

Headers:

{
  "x-api-key": "your-api-key"
}

No body is required. Just include the API key.

Response

Headers:

{
  "Content-Type": "image/png"
}

Body:

<binary image data>

Returns the image file as binary data.

Example

curl -X GET https://api.genimix.dev/v1/my-project/image/abc123 \
  -H "x-api-key: sk_..." \
  --output image.png

Delete Image

DELETE /v1/:projectId/image/:imageId

Deletes the image associated with the given project and image ID. If the image does not exist, a 404 response is returned.

Request

Headers:

{
  "x-api-key": "your-api-key"
}

Only the API key is required in the header. No body.

Response

Headers:

{
  "Content-Type": "application/json"
}

Body:

{
  "success": true,
  "deleted": ":imageId"
}

Returns confirmation of the deletion.

Example

curl -X DELETE https://api.genimix.dev/v1/my-project/image/abc123 \
  -H "x-api-key: sk_..."