Inference
Create response
Generate an image or video.
POST
Send a text prompt or image to generate a new image or video.
See the Supported models page to find which models support these different modalities.
This API is built on the Open Responses spec, a provider-agnostic API standard.
Authorizations
Modular Cloud API key. Obtain from the API keys page.
Body
application/json
Model identifier. See the supported models page.
Example:
"black-forest-labs/FLUX.2-klein-4B"
Model input. Pass a plain string for text-to-image/video, or a structured content array for image-to-image/video.
Random seed for reproducible outputs.
Response
200 - application/json
Response object containing generated content.
Unique identifier for the response.
The object type. Always response.
Available options:
response Unix timestamp (in seconds) of when the response was created.
The status of the response.
Available options:
completed, failed The model used to generate the response.
The messages generated by the model.
Usage statistics for the response.