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())
Post 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 hereresponse_format
[url, b64_json] - default “url”.
Currently,
size
is not supported. Please contact me if you miss anything.