Image Generation
Create Image
POST /images/generations
Generate images using the selected provider and model
Pass the config parameters for the request in the headers as defined here.
Portkey automatically transforms the parameters for image models according the parameters accepted by them.
SDK Usage
The images.create
method in the Portkey or OpenAI SDK allows you to generate images using various image models. This method provides a straightforward interface for requesting image generations.
Method Signature
Parameters
requestParams (Object): Parameters for the completion request. These parameters should include the prompt and model, and are transformed automatically by Portkey for image models.
configParams (Object): Additional configuration options for the request. This is an optional parameter that can include custom config options for this specific request. These will override the configs set in the Portkey Client.
Example Usage
Response Format
The response will conform to the Image Generation Object schema from the Portkey API, typically including the generated image based on the prompt and the selected model.
Reference:
Last updated