IMAGE API
Use Flare to iterate on illustrations and product visuals. Reference image edits · NewRouters Images API
POST
/v1/tasksMODELgpt-image-2.6-flareCode examples & responses
/v1/tasksServer-side request
curl "https://newrouters.com/v1/tasks" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
--data '{
"model": "gpt-image-2.6-flare",
"input": {
"prompt": "Change the cup to blue. Preserve the handle and background.",
"size": "auto",
"quality": "low",
"output_format": "jpeg",
"images": [
"https://example.com/cup.png"
]
}
}'Server-side request
const apiBaseUrl = "https://newrouters.com";
const apiKey = process.env.API_KEY;
if (!apiKey) throw new Error("Set API_KEY in your server environment");
const response = await fetch(apiBaseUrl + "/v1/tasks", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer " + apiKey
},
body: JSON.stringify({
"model": "gpt-image-2.6-flare",
"input": {
"prompt": "Change the cup to blue. Preserve the handle and background.",
"size": "auto",
"quality": "low",
"output_format": "jpeg",
"images": [
"https://example.com/cup.png"
],
"resolution": "2k"
}
})
});
const result = await response.json();
if (!response.ok) throw new Error(JSON.stringify(result));
console.log(result);Server-side request
import json
import os
from urllib.request import Request, urlopen
api_base_url = "https://newrouters.com"
api_key = os.environ["API_KEY"]
body = json.loads("{\"model\":\"gpt-image-2.6-flare\",\"input\":{\"prompt\":\"Change the cup to blue. Preserve the handle and background.\",\"size\":\"auto\",\"quality\":\"low\",\"output_format\":\"jpeg\",\"images\":[\"https://example.com/cup.png\"],\"resolution\":\"2k\"}}")
request = Request(
api_base_url + "/v1/tasks",
data=json.dumps(body).encode("utf-8"),
headers={
"Content-Type": "application/json",
"Authorization": "Bearer " + api_key
},
method="POST",
)
with urlopen(request) as response:
print(json.load(response))The API origin is filled in. Set API_KEY before running. Examples never submit automatically.
202Task accepted
JSON
{
"id": "TASK_ID",
"status": "pending",
"model": "gpt-image-2.6-flare",
"result": null,
"error": null
}200Successful result
JSON
{
"id": "TASK_ID",
"status": "succeeded",
"model": "gpt-image-2.6-flare",
"result": {
"assets": [
"https://example.com/output.png"
]
},
"error": null
}- Create a task01
POST /v1/tasksSubmit model + input. Save the returned task id.
202 · pending - Poll status02
GET /v1/tasks/{id}Wait and poll again while pending or processing.
Wait → poll again - Read the outcome03
result.assets[] / errorRead the result for the terminal task state.
succeeded→ assetsfailed→ error
Use Flare to iterate on illustrations and product visuals. Use the NewRouters model ID gpt-image-2.6-flare.
Replace the example URL in input.images with an accessible reference image. Describe the change and what to preserve. Choose JPEG, PNG or WebP for edits.
curl "https://newrouters.com/v1/tasks" \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ --data '{ "model": "gpt-image-2.6-flare", "input": { "prompt": "Change the cup to blue. Preserve the handle and background.", "size": "auto", "quality": "low", "output_format": "jpeg", "images": [ "https://example.com/cup.png" ] }}'Save the task ID and poll GET /v1/tasks/{id} with the same key. On success, download the file from result.assets.