> ## Documentation Index
> Fetch the complete documentation index at: https://docs.darkbloom.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate images from text with Darkbloom's API

> POST /v1/images/generations generates images from a text prompt using the OpenAI-compatible image endpoint, served by attested Apple Silicon providers.

`POST /v1/images/generations` generates images from a text prompt. The endpoint follows the OpenAI Images API format — you send a prompt and receive a response containing the generated image. Providers serving image generation run the image backend on Apple Silicon alongside the text inference process.

## Request parameters

<ParamField body="prompt" type="string" required>
  A text description of the image you want to generate.
</ParamField>

<ParamField body="n" type="number" default="1">
  The number of images to generate. Currently `1` is recommended.
</ParamField>

<ParamField body="size" type="string" default="1024x1024">
  The dimensions of the generated image. Supported values depend on the provider's image backend configuration.
</ParamField>

## Examples

<CodeGroup>
  ```bash curl theme={null}
  curl https://api.darkbloom.dev/v1/images/generations \
    -H "Authorization: Bearer eigeninference-your-key-here" \
    -H "Content-Type: application/json" \
    -d '{
      "prompt": "A neon-lit Apple Silicon chip floating in a dark ocean, cinematic, dramatic lighting",
      "n": 1,
      "size": "1024x1024"
    }'
  ```

  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(
      base_url="https://api.darkbloom.dev/v1",
      api_key="eigeninference-your-key-here",
  )

  response = client.images.generate(
      prompt="A neon-lit Apple Silicon chip floating in a dark ocean, cinematic, dramatic lighting",
      n=1,
      size="1024x1024",
  )

  print(response.data[0].url)
  ```
</CodeGroup>

## Response

```json theme={null}
{
  "created": 1714500000,
  "data": [
    {
      "url": "https://..."
    }
  ]
}
```

<ResponseField name="created" type="number">
  Unix timestamp for when the image was generated.
</ResponseField>

<ResponseField name="data" type="object[]">
  Array of generated image objects.

  <Expandable title="image object fields">
    <ResponseField name="url" type="string">
      URL to the generated image. The URL is temporary — download the image promptly if you need to persist it.
    </ResponseField>
  </Expandable>
</ResponseField>

<Note>
  Image generation is served by providers that have opted into running the image backend. Availability may be more limited than text inference. If no image providers are online, the request will queue and retry before returning an error.
</Note>
