POST
/
dedicated
/
v1
/
images
/
generations
curl --request POST \
  --url https://api.friendli.ai/dedicated/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "(endpoint-id)",
  "prompt": "An orange Lamborghini driving down a hill road at night with a beautiful ocean view in the background."
}'
{
  "data": [
    {
      "url": "(url-to-generated-image)",
      "seed": "123",
      "response_format": "url"
    }
  ]
}

To successfully run an inference request, it is mandatory to enter a Friendli Token (e.g. flp_XXX) value in the Bearer Token field. Refer to the authentication section on our introduction page to learn how to acquire this variable and visit here to generate your token.

When streaming mode is used (i.e., stream option is set to true), the response is in MIME type text/event-stream. Otherwise, the content type is application/json. You can view the schema of the streamed sequence of chunk objects in streaming mode here.

This API is currently in Beta. While we strive to provide a stable and reliable experience, this feature is still under active development. As a result, you may encounter unexpected behavior or limitations. We encourage you to provide feedback to help us improve the feature before its official release.

Authorizations

Authorization
string
header
required

When using Friendli Suite API for inference requests, you need to provide a Friendli Token for authentication and authorization purposes.

For more detailed information, please refer here.

Headers

X-Friendli-Team
string | null

ID of team to run requests as (optional parameter).

Body

application/json
model
string
required

ID of target endpoint. If you want to send request to specific adapter, use the format "YOUR_ENDPOINT_ID:YOUR_ADAPTER_ROUTE". Otherwise, you can just use "YOUR_ENDPOINT_ID" alone.

Example:

"(endpoint-id)"

prompt
string
required

A text description of the desired image(s).

num_inference_steps
integer | null
default:36

The number of inference steps to use during image generation. Supported range: [1, 50]. Defaults to 36.

response_format
enum<string> | null
default:url

The format in which the generated image(s) will be returned. One of url(default), raw, png, jpeg, and jpg.

Available options:
url,
raw,
png,
jpeg,
jpg
seed
integer | null

The seed to use for image generation.

Response

200
application/json
Successfully generated image(s).
data
required