Quick start
Text to Image example:
Section titled “Text to Image example:”curl 'https://api.imagerouter.io/v1/openai/images/generations' \-H 'Authorization: Bearer YOUR_API_KEY' \--json '{ "prompt": "YOUR_PROMPT", "model": "test/test"}'const url = 'https://api.imagerouter.io/v1/openai/images/generations';const payload = { prompt: 'YOUR_PROMPT', model: 'test/test'};
const response = await fetch(url, { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify(payload)});
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"}
response = requests.post(url, json=payload, headers=headers)print(response.json())