Generate Images

POST /v1/images/generations

Generate images based on the provided prompt and model parameters.

application/json

Body Required

  • model string Required

    The ID of the model to use for image generation.

  • prompt string Required

    A text description of the desired image(s).

  • n integer

    The number of images to generate.

    Minimum value is 1, maximum value is 10. Default value is 1.

  • size string

    The size of the generated images.

    Values are 1024x1024, 512x512, or 256x256. Default value is 1024x1024.

  • The format in which the generated images are returned.

    Values are url or b64_json. Default value is url.

  • user string

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

  • Optional Discord webhook URL for notifications.

Responses

  • 200 application/json

    Successful Response

    Hide response attributes Show response attributes object
    • created integer Required

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

    • data array[object] Required

      An array of generated image data.

      Hide data attributes Show data attributes object
      • url string Required

        The URL of the generated image.

      • b64_json string

        The base64-encoded JSON of the generated image. Only present when response_format is b64_json.

  • 400 application/json

    Bad Request

    Hide response attribute Show response attribute object
    • error object Required
      Hide error attributes Show error attributes object
      • message string Required

        A human-readable error message.

      • type string Required

        The type of error that occurred.

      • param string | null Required

        The parameter that caused the error, if applicable.

      • code string Required

        A machine-readable error code.

  • 401 application/json

    Unauthorized

    Hide response attribute Show response attribute object
    • error object Required
      Hide error attributes Show error attributes object
      • message string Required

        A human-readable error message.

      • type string Required

        The type of error that occurred.

      • param string | null Required

        The parameter that caused the error, if applicable.

      • code string Required

        A machine-readable error code.

  • 429 application/json

    Too Many Requests

    Hide response attribute Show response attribute object
    • error object Required
      Hide error attributes Show error attributes object
      • message string Required

        A human-readable error message.

      • type string Required

        The type of error that occurred.

      • param string | null Required

        The parameter that caused the error, if applicable.

      • code string Required

        A machine-readable error code.

POST /v1/images/generations
curl \
 -X POST https://api.rimunace.xyz/v1/images/generations \
 -H "Authorization: $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"model":"string","prompt":"string","n":1,"size":"1024x1024","response_format":"url","user":"string","discord_webhook_url":"https://example.com"}'
Request examples
{
  "model": "string",
  "prompt": "string",
  "n": 1,
  "size": "1024x1024",
  "response_format": "url",
  "user": "string",
  "discord_webhook_url": "https://example.com"
}
Response examples (200)
{
  "created": 42,
  "data": [
    {
      "url": "string",
      "b64_json": "string"
    }
  ]
}
Response examples (400)
{
  "error": {
    "message": "string",
    "type": "string",
    "param": "string",
    "code": "string"
  }
}
Response examples (401)
{
  "error": {
    "message": "string",
    "type": "string",
    "param": "string",
    "code": "string"
  }
}
Response examples (429)
{
  "error": {
    "message": "string",
    "type": "string",
    "param": "string",
    "code": "string"
  }
}