Skip to main content
POST
/
api
/
v1
/
llm
/
images
/
generations
Python (SDK)
from mka1 import SDK


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.llm.images.create(prompt="A serene mountain landscape at sunset with a lake reflection", model="auto", n=1, quality="hd", response_format="url", size="1024x1024", style="vivid")

    # Handle response
    print(res)
{
  "created": 1704067200,
  "data": [
    {
      "url": "https://example.com/generated-image.png",
      "revised_prompt": "A serene mountain landscape at sunset with a calm lake reflection, digital art style"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.mka1.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.

Headers

X-On-Behalf-Of
string

Optional external end-user identifier forwarded by the API gateway.

Body

application/json

Request parameters for generating images. Creates one or more images from a text prompt.

prompt
string
required

A text description of the desired image(s). The maximum length is 1000 characters.

Required string length: 1 - 1000
model
string
default:auto

The model to use for image generation. Defaults to 'auto'.

n
integer
default:1

The number of images to generate. Must be between 1 and 10. Defaults to 1.

Required range: 1 <= x <= 10
quality
enum<string>
default:auto

The quality tier of the generated image. Higher tiers may incur higher latency or cost. 'auto' lets the gateway pick a sensible value per model. 'standard' and 'hd' are accepted as legacy aliases.

Available options:
low,
medium,
high,
auto,
standard,
hd
response_format
enum<string>
default:url

The format in which the generated images are returned. 'url' returns a URL to the image, 'b64_json' returns the image as a base64-encoded JSON string. Defaults to 'url'.

Available options:
url,
b64_json
size
enum<string>
default:1024x1024

The size of the generated image. 'auto' defers to the model's default.

Available options:
256x256,
512x512,
1024x1024,
1024x1536,
1536x1024,
1792x1024,
1024x1792,
auto
style
enum<string>
default:vivid

The style of the generated image. 'vivid' leans toward hyper-real and dramatic. 'natural' produces more naturalistic results. Conditionally supported.

Available options:
vivid,
natural
output_format
enum<string>

Output file format. Conditionally supported.

Available options:
png,
webp,
jpeg
user
string

A unique identifier representing your end-user, which can help monitor and detect abuse.

Response

200 - application/json

OK

Response from the image generation endpoint containing the generated images and metadata.

created
number
required

The Unix timestamp (in seconds) of when the image generation was completed.

data
object[]
required

A list of image objects containing the generated image data.