Generate an image
OpenAI compatible image generation endpoint. If the model does not respond in time, the request will be timed out and the prediction will be cancelled.
In: header
The model to use for this OpenAI compatible endpoint. Models must be in the following format: model_owner/model_name or model_owner/model_name:version_number.
A text description of the desired image(s).
Allows to set transparency for the background of the generated image(s).
Control the content-moderation level for images generated by the image models.
The number of images to generate.
The compression level for the generated images.
The format in which the generated images are returned.
The number of partial images to generate.
The quality of the image that will be generated.
The format in which generated images are returned.
The size of the generated images.
The style of the generated images.
Response Body
curl -X POST "https://api.wrift.ai/v1/images/generations" \ -H "Content-Type: application/json" \ -d '{ "model": "string", "prompt": "string" }'{
"created": 0,
"background": "transparent",
"data": [
{
"b64_json": "string",
"revised_prompt": "string",
"url": "string"
}
],
"output_format": "png",
"quality": "low",
"size": "1024x1024",
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"image_tokens": 0,
"text_tokens": 0
},
"output_tokens": 0,
"total_tokens": 0,
"output_tokens_details": {
"image_tokens": 0,
"text_tokens": 0
}
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Create an embedding POST
OpenAI compatible embeddings endpoint. If the model does not respond in time, the request will be timed out and the prediction will be cancelled.
Cancel a prediction POST
Cancel a prediction by its id. Only predictions that have not yet terminated can be cancelled. Cancellation is asynchronous and the prediction's status will remain unchanged until cancellation takes effect. Requesting cancellation for a prediction that has already been requested for cancellation is idempotent. Attempting to cancel a terminated prediction will return an error.