Image Generation
Generate images with any model available on ImageRouter.
curl 'https://api.imagerouter.io/v1/openai/images/generations' \-H 'Authorization: Bearer YOUR_API_KEY' \-H 'Content-Type: application/json' \--data-raw '{"prompt": "YOUR_PROMPT", "model": "test/test"}'
const url = 'https://api.imagerouter.io/v1/openai/images/generations';const options = { method: 'POST', headers: {Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json'}, body: '{"prompt": "YOUR_PROMPT", "model": "test/test"}'};
const response = await fetch(url, options);const data = await response.json();console.log(data);
import requests
url = "https://api.imagerouter.io/v1/openai/images/generations"payload = { "prompt": "YOUR_PROMPT", "model": "test/test",}headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)print(response.json())
Parameners:
prompt
* Text prompt for generating images.model
* Image model to use for generation.quality
[auto, low, medium, high] - default “auto”; Supported models have “quality” feature label heresize
[auto, WIDTHxHEIGHT (eg 1024x1024)] - default “auto”; Accepted values are different for each model. Some models and providers completely ignoresize
.response_format
[url, b64_json] - default “url”.image[]
Input image(s) for supported image editing models.mask[]
Some models require a mask file to specify areas to edit.
Please contact me if you miss anything.