> ## 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.

# Image generation

> Generate an image directly from a prompt using the standalone Images API.

Call the Images API when your application already has the image prompt. To let a model generate an image during an interaction, use [image generation through Responses](/docs/image-generation).

See the Responses guide for [image models](/docs/image-generation#image-generation-models), and the [API reference](/api-reference/images/generate-images-from-text-descriptions) for endpoint details.

## Images API

<CodeGroup>
  ```ts TypeScript SDK theme={null}
  import { SDK } from '@meetkai/mka1';

  const sdk = new SDK({ bearerAuth: 'Bearer <mka1-api-key>' });

  const imageResult = await sdk.llm.images.create({
    imageGenerationRequest: {
      model: 'auto',
      prompt: 'A futuristic city skyline at dusk',
    },
  });

  // imageResult.data[0].url contains the generated image URL
  ```

  ```ts OpenAI SDK theme={null}
  import OpenAI from 'openai';

  const openai = new OpenAI({
    apiKey: '<mka1-api-key>',
    baseURL: 'https://apigw.mka1.com/api/v1/llm/',
  });

  const imageResult = await openai.images.generate({
    model: 'auto',
    prompt: 'A futuristic city skyline at dusk',
  });

  console.log(imageResult.data?.[0]?.url);
  ```

  ```python Python SDK theme={null}
  from meetkai_mka1 import SDK

  sdk = SDK(bearer_auth="Bearer <mka1-api-key>")

  image_result = sdk.llm.images.create(
      model="auto",
      prompt="A futuristic city skyline at dusk",
  )

  # image_result.data[0].url contains the generated image URL
  ```

  ```csharp C# SDK theme={null}
  using MeetKai.MKA1;
  using MeetKai.MKA1.Types.Components;

  var sdk = new SDK(bearerAuth: "Bearer <mka1-api-key>");

  var imageResult = await sdk.Llm.Images.CreateAsync(new ImageGenerationRequest()
  {
      Model = "auto",
      Prompt = "A futuristic city skyline at dusk",
  });

  // imageResult.Data[0].Url contains the generated image URL
  ```

  ```bash CLI theme={null}
  mka1 llm images create \
    --model auto \
    --prompt 'A futuristic city skyline at dusk'
  ```

  ```bash Bash theme={null}
  curl https://apigw.mka1.com/api/v1/llm/images/generations \
    --request POST \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer <mka1-api-key>' \
    --data '{
      "model": "auto",
      "prompt": "A futuristic city skyline at dusk"
    }'
  ```
</CodeGroup>
