LimeWire API (Version 1.1.1)

Download OpenAPI specification:Download

Introduction

Welcome to LimeWire Developer, a collection of RESTful APIs leveraging state-of-the-art generative AI models to allow for operations like text-to-image generation, image-to-image generation, background removal, image inpainting, image outpainting, image upscaling, and more. In due course, additional API endpoints for AI music and AI video generation will be released as well.

Authentication

For every API request you make, you will need to make sure to be authenticated with the API by passing your API key as an Authorization header to the API. You can find an manage your API key by logging in to your LimeWire account and navigating to your Account Settings.

See below for an example:

Authorization: Bearer <YOUR_API_KEY>

Versioning

You are currently looking at the documentation for API version 1.0.0. Whenever you make an API request, it is recommended that you specify your desired API version using the optional X-Api-Version header. If no header is specified, the API will default to version v1.

See below for an example:

X-Api-Version: v1

Rate Limit

The API is rate limited according to your subscription plan. If your usage exceeds rate limit, the API will return the following error response:

429 Too Many Requests

Errors

The API uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g. a required parameter was omitted, a validation error, etc.), and codes in the 5xx range indicate an error with LimeWire's servers.

All of our error responses follow the RFC 7807 standard. For more information, please refer to each API endpoint's documentation and examples below.

Image Endpoints

Our image API endpoints will allow you to perform a series of operations, including text-to-image generation, image-to-image generation, background removal, image inpainting, image outpainting as well as image upscaling.

Generate Image

Use this endpoint to generate a new image based on a text prompt (text-to-image). Instead of just passing a text prompt to the API, you can optionally also pass an existing image to the API (image-to-image) as the basis for your newly generated image.

SecurityapiKey
Request
header Parameters
X-Api-Version
string
Default: v1

The version of the API to use, defaults to v1

Value: "v1"
Accept
string
Default: application/json

Response content type, defaults to application/json. Types other than application/json are only supported when requesting a single object.

Enum: "application/json" "image/png"
Request Body schema:
required
prompt
required
string (Prompt) <= 2000 characters

Specify a text prompt describing the desired image, with a maximum length of 2000 characters.

negative_prompt
string (NegativePrompt) <= 2000 characters

Specify a text prompt describing what should not be included in the image.

image_asset_id
string

Specify the ID of the image asset to use as inspiration for the image generation process. You can upload images using the /upload endpoint or use assset_id of previously generated image. Provided images should have the same aspect ratio as the image you want to generate.

image
string <binary>

Specify the image to use as a source for the generation process. This parameter is required for multi-part requests.

samples
integer (Samples) [ 1 .. 4 ]
Default: 1

Specify the desired number of images to generate.

quality
string (GenerateImgQualityEnum)
Default: "MID"

Specify the desired quality of your image, ranging from low quality to high quality.

Enum: "LOW" "MID" "HIGH"
guidance_scale
integer [ 1 .. 100 ]
Default: 40

Specify how strictly the diffusion process adheres to your text prompt. A higher value will keep the generated image closer to your specified text prompt.

aspect_ratio
required
string (AspectRatioEnum)
Default: "1:1"

Specify your desired aspect ratio. Deprecated aspect ratios for text-to-image: 2:3, 3:2

Enum: "1:1" "13:19" "19:13" "2:3" "3:2"
style
string (ImageStyleEnum)

Specify one of our pre-configured image styles, including photorealistic, sci-fi and landscape styling.

Enum: "PHOTOREALISTIC" "SCIFI" "LANDSCAPE"
Responses
200

ok

400

Bad request

401

API key not provided or invalid

429

Too many requests

500

Unknown internal server error

post/image/generation
Request samples
{
  • "prompt": "A cute baby sea otter",
  • "aspect_ratio": "1:1"
}
Response samples
{}

Upscale Image

Use this endpoint to upscale an image by a scaling factor of your choice. Upscaling is the process of increasing the size of an image without compromising on image sharpness or quality. Find below an overview of the scale factors supported by the API.

Scale factor 2: the maximum input image size is 1024x1024 pixels (2,097,576 pixels).
Scale factor 3: the maximum input image size is 680x680 pixels (462,400 pixels).
Scale factor 4: the maximum input image size is 1256x1256 pixels (1,577,536 pixels).
SecurityapiKey
Request
header Parameters
X-Api-Version
string
Default: v1

The version of the API to use, defaults to v1

Value: "v1"
Accept
string
Default: application/json

Response content type, defaults to application/json. Types other than application/json are only supported when requesting a single object.

Enum: "application/json" "image/png"
Request Body schema:
required
image_asset_id
string

Specify the ID of the image asset to use as a source for the upscaling process. This parameter is required for application/json requests.

image
string <binary>

Specify the image to use as a source for the upscaling process. This parameter is required for multi-part requests.

upscale_factor
required
integer

The upscale factor

Enum: 2 3 4
Responses
200

ok

400

Bad request

401

API key not provided or invalid

429

Too many requests

500

Unknown internal server error

post/image/upscaling
Request samples
{
  • "image_asset_id": "116a972f-666a-44a1-a3df-c9c28a1f56c0",
  • "upscale_factor": 2
}
Response samples
{}

Outpaint Image

Use this endpoint to outpaint an image. Outpainting is the process of extending one or all boundaries around an image by logically generating new objects and backgrounds based on the existing contents of the image.

SecurityapiKey
Request
header Parameters
X-Api-Version
string
Default: v1

The version of the API to use, defaults to v1

Value: "v1"
Accept
string
Default: application/json

Response content type, defaults to application/json. Types other than application/json are only supported when requesting a single object.

Enum: "application/json" "image/png"
Request Body schema:
required
prompt
string (Prompt) <= 2000 characters

Specify a text prompt describing the desired image, with a maximum length of 2000 characters.

negative_prompt
string (NegativePrompt) <= 2000 characters

Specify a text prompt describing what should not be included in the image.

image_asset_id
string

Specify the ID of the image asset to use as a source for the outpainting process. This parameter is required for application/json requests.

image
string <binary>

Specify the image to use as a source for the outpainting process. This parameter is required for multi-part requests.

samples
integer (Samples) [ 1 .. 4 ]
Default: 1

Specify the desired number of images to generate.

direction
required
string (OutpaintDirectionEnum)

Specify whether your image should be outpainted into one direction (e.g. up, down, left or right) or all directions.

Enum: "UP" "DOWN" "LEFT" "RIGHT" "ALL"
crop_side
required
string (OutpaintCropSideEnum)

Specify the side of the image that can be cropped for the purpose of outpainting. Cropping does not occur for all requests, only if deemed necessary by the AI model in order to produce a satisfactory result.

Enum: "LEFT" "RIGHT" "TOP" "BOTTOM"
Responses
200

ok

400

Bad request

401

API key not provided or invalid

429

Too many requests

500

Unknown internal server error

post/image/outpainting
Request samples
{
  • "image_asset_id": "116a972f-666a-44a1-a3df-c9c28a1f56c0",
  • "direction": "UP",
  • "crop_side": "LEFT"
}
Response samples
{}

Inpaint image

Use this endpoint to modify certain parts of an image based on a text prompt you specify in your request. The area that will be manipulated can be chosen in different ways:

  • By providing a mask_color_rgba that will be applied to the input image. Every pixel that matches the specified color will be replaced using the prompt.
  • By providing a dedicated mask_asset_id, on which the mask_color_rgba will be applied.
SecurityapiKey
Request
header Parameters
X-Api-Version
string
Default: v1

The version of the API to use, defaults to v1

Value: "v1"
Accept
string
Default: application/json

Response content type, defaults to application/json. Types other than application/json are only supported when requesting a single object.

Enum: "application/json" "image/png"
Request Body schema:
required
prompt
required
string (Prompt) <= 2000 characters

Specify a text prompt describing the desired image, with a maximum length of 2000 characters.

negative_prompt
string (NegativePrompt) <= 2000 characters

Specify a text prompt describing what should not be included in the image.

image_asset_id
string

Specify the ID of the image asset to use as a source for the inpainting process. This parameter is required for application/json requests.

image
string <binary>

Specify the image to use as a source for the inpainting process. This parameter is required for multi-part requests.

samples
integer (Samples) [ 1 .. 4 ]
Default: 1

Specify the desired number of images to generate.

mask_asset_id
string

Specify the ID of the image asset that will be used as the mask. If no value is supplied, the masking related parameters will be applied to the input image.

mask
string <binary>

Specify the image to use as a mask. This parameter is required for multi-part requests.

mask_color_rgba
Array of integers = 4 items
Default: [0,0,0,0]

Specify which pixels will be used to be replaced on the input image, in the format [red,green,blue,alpha]. For example:

  • [0,0,0,0] -> fully transparent pixels
  • [0,0,0,255] -> non-transparent black pixels
  • [255,255,255,255] -> non-transparent white pixels
  • [255,0,0,255] -> non-transparent red pixels
mask_color_threshold
integer [ 0 .. 100 ]
Default: 0

Specify how much the pixels are allowed to deviate from mask_color_rgba in percent. This is useful e.g. when the background of an image should be replaced, but it's not fully white. For example using [255,255,255,255] (non-transparent white pixels) with a threshold of 10 would mask anything between [230,230,230,230] and [255,255,255,255].

Responses
200

ok

400

Bad request

401

API key not provided or invalid

429

Too many requests

500

Unknown internal server error

post/image/inpainting
Request samples
{
  • "image_asset_id": "116a972f-666a-44a1-a3df-c9c28a1f56c0",
  • "prompt": "A cute baby sloth"
}
Response samples
{}

Meta

Below you will find a series of endpoints that are used as ancillary endpoints when using the API.

Upload Asset

Use this endpoint to upload an asset for further processing by the API. Uploaded assets are available for 24 hours after upload.

SecurityapiKey
Request
Request Body schema:
string <binary>
Responses
200

ok

400

Bad request

401

API key not provided or invalid

429

Too many requests

500

Unknown internal server error

post/upload
Request samples
Response samples
application/json
{}

Limitations

API Limitations

The Studio API has the following limitations:

  • Client generated content is available for 24 hours to the client.
  • Client uploaded content is available for 24 hours to the client.
  • The maximum size of the client uploaded content is 10 MB.
  • The maximum number of parallel requests is based on the client's subscription plan.

Pricing

Pricing for Studio API

The Studio API execute request against the best fitting model and price of each call is decided based on request parameters.

Each successful response contains a field credits_used that indicates the number of credits used for the call and credits_remaining that indicates the number of credits remaining in your account.

Changelog

[1.0.0] - 2023-11-23

  • Added
    • Initial api version