Quick Start
Welcome to the Nero AI API
Welcome.
The Nero AI API is a business-oriented image processing API that provides AI-based image enhancement and generation services.
It enables you to integrate features such as image upscaling, restoration, colorization, background removal, image to video, and image generation into your products, internal tools, or automated workflows through a unified API.
The API is designed for reliable, scalable image processing with clear credit-based usage and task-oriented execution.
Authorization
Get Your API Key
To use the Nero AI API, you must first create a Nero AI account.
After signing in, go to the API Service page to generate and copy your API key:
A valid API key and sufficient credits are required to make API requests.
All requests must include the API key in the request header:
x-neroai-api-key: YOUR_API_KEY
Requests without a valid API key or without enough credits will be rejected.
Secondary API Key
A secondary API key is an additional API key created under the same account. It can be used alongside your primary key to separate usage by environment, application, or purpose.
All API keys under the same account share the same Credit balance.

API Services
What the Nero AI API Can Do
The Nero AI API provides a rich suite of image and media tools, including:

Image Upscale & Enhancement
- ImageUpscaler – Boost image resolution and clarity (2×, 4×, 8×).
- ImageSharpener – Improve image sharpness and clarity.
- ImageDenoiser – Remove visual noise and artifacts.
- ScratchFix – Intelligent scratch and mark removal.
- FaceRestoration – Improve facial clarity and recover missing details.
- ColorizePhoto – Add color to black & white images.
Image Editing & Generation
- BackgroundRemoval – Automatically remove image backgrounds.
- BackgroundChanger – Replace the background after removal.
- BackgroundGenerator – Generate backgrounds based on the subject, user prompts, or selected templates.
- FaceAnimation – Enhance facial images and animate static portraits.
- ImageToImage – Redraw image content by applying AI filters and style templates.
- AvatarGenerator - Generate stylized avatars based on the input portrait image.
Video Generation
- ImageToVideo – Create a short video based on input images.
Image Optimization
- ImageCompressor – Reduce file size with optional quality strategies.
Image Analysis
- ObjectCounter – Detect and count identical object types in an image.
Create and Query AI Tasks
All AI task APIs are asynchronous. You can get the results through query or webhook.
Create a task
POST https://api.nero.com/biz/api/task
Query task result
GET https://api.nero.com/biz/api/task?task_id=
Webhook
Provide a url to which the result will be sent when the task is completed. If the webhook invoke fails, it will be retried three times to ensure the result is sent.
Request body
{
"type": "ImageUpscaler:Standard",
"body": {
"image": "https://image.url"
},
"info": {
"webhook": "https://webhook.url"
}
}
The result will be sent.
{
"task_id": "bmtrfykh",
"status": "done",
"result": {
"output": "https://image.url"
}
}
ImageUpscaler
Supported Formats
Currently, the supported file formats are JPG, JPEG, PNG, BMP, WEBP, JFIF, JFI, JPE, JIF and ICO.
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'ImageUpscaler:Standard',
body: {
image: 'https://image.url',
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'ImageUpscaler:Standard',
'body': {
'image': 'https://image.url',
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'ImageUpscaler:Standard',
body: {
image: 'https://image.url',
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'ImageUpscaler:Standard',
'body' => [
'image' => 'https://image.url',
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "ImageUpscaler:Standard");
JSONObject body = new JSONObject();
body.put("image", "https://image.url");
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "ImageUpscaler:Standard",
body = new
{
image = "https://image.url"
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "ImageUpscaler:Standard",
"body": [
"image": "https://image.url"
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"ImageUpscaler:Standard",
@"body": @{
@"image": @"https://image.url"
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "ImageUpscaler:Standard",
"body": {
"image": "https://image.url"
}
}')
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | ImageUpscaler:Standard | ImageUpscaler:Photograph | ImageUpscaler:Anime | ImageUpscaler:FaceEnhancement | ImageUpscaler:Iris |
| body.image | string | true | an image url |
| body.quality_factor | number | false | the quality factor of result. the larger the value, the higher the quality. range is [80, 100], default is 95. only takes effect when the result is one of jpg or jpeg or webp |
| body.presigned_url | string | false | a presigned URL generated for temporary upload access to private objects. |
| body.upscaling_rate | number | false | upscaling rate, 2, 4 or 8, default is 4 (face enhancement is not supported) |
| body.face_enhance | boolean | false | enable face enhance, default is false |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://image.url"
}
}
}

ImageSharpener
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'ImageSharpener',
body: {
image: 'https://image.url',
model: 'sharp',
face_enhance: true
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'ImageSharpener',
'body': {
'image': 'https://image.url',
'model': 'sharp',
'face_enhance': True
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'ImageSharpener',
body: {
image: 'https://image.url',
model: 'sharp',
face_enhance: true
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'ImageSharpener',
'body' => [
'image' => 'https://image.url',
'model' => 'sharp',
'face_enhance' => true
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "ImageSharpener");
JSONObject body = new JSONObject();
body.put("image", "https://image.url");
body.put("model", "sharp");
body.put("face_enhance", true);
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "ImageSharpener",
body = new
{
image = "https://image.url",
model = "sharp",
face_enhance = true
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "ImageSharpener",
"body": [
"image": "https://image.url",
"mode": "sharp",
"face_enhance": true
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"ImageSharpener",
@"body": @{
@"image": @"https://image.url",
@"model": @"sharp",
@"face_enhance": @YES
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "ImageSharpener",
"body": {
"image": "https://image.url",
"model": "sharp",
"face_enhance": true
}
}')
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | ImageSharpener |
| body.image | string | true | an image url |
| body.model | string | false | 'sharp', 'balanced', 'gentle', 'anime', default is sharp sharp: High-strength enhancement that maximizes detail visibility. Produces sharper results than the balanced model. balanced: Medium-strength enhancement ideal for everyday photos, improving both clarity and detail. gentle: Subtle enhancement that stays true to the original image, delivering softer results than the balanced model. anime: Optimized for AI artwork, illustrations, paintings, anime, and cartoons. |
| body.face_enhance | boolean | false | default is false |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://image.url"
}
}
}
ImageDenoiser
Supported Formats
Currently, the supported file formats are JPG, JPEG, PNG, BMP, WEBP, JFIF, JFI, JPE and JIF.
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'ImageDenoiser',
body: {
image: 'https://image.url'
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'ImageDenoiser',
'body': {
'image': 'https://image.url'
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'ImageDenoiser',
body: {
image: 'https://image.url'
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'ImageDenoiser',
'body' => [
'image' => 'https://image.url'
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "ImageDenoiser");
JSONObject body = new JSONObject();
body.put("image", "https://image.url");
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "ImageDenoiser",
body = new
{
image = "https://image.url"
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "ImageDenoiser",
"body": [
"image": "https://image.url"
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"ImageDenoiser",
@"body": @{
@"image": @"https://image.url"
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "ImageDenoiser",
"body": {
"image": "https://image.url"
}
}')
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | ImageDenoiser |
| body.image | string | true | an image url |
| body.presigned_url | string | false | a presigned URL generated for temporary upload access to private objects. |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://image.url"
}
}
}

ScratchFix
Supported Formats
Currently, the supported file formats are JPG, JPEG, PNG, BMP, WEBP, JFIF, JFI, JPE, JIF.
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'ScratchFix',
body: {
image: 'https://image.url'
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'ScratchFix',
'body': {
'image': 'https://image.url'
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'ScratchFix',
body: {
image: 'https://image.url'
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'ScratchFix',
'body' => [
'image' => 'https://image.url'
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "ScratchFix");
JSONObject body = new JSONObject();
body.put("image", "https://image.url");
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "ScratchFix",
body = new
{
image = "https://image.url"
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "ScratchFix",
"body": [
"image": "https://image.url"
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"ScratchFix",
@"body": @{
@"image": @"https://image.url"
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "ScratchFix",
"body": {
"image": "https://image.url"
}
}')
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | ScratchFix |
| body.image | string | true | an image url |
| body.mask | string | false | user-created scratch mask image url |
| body.presigned_url | string | false | a presigned URL generated for temporary upload access to private objects. |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://image.url",
"mask": "https://image.url"
}
}
}

FaceRestoration
Supported Formats
Currently, the supported file formats are JPG, JPEG, PNG, BMP, WEBP, JFIF, JFI, JPE, JIF.
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'FaceRestoration',
body: {
image: 'https://image.url'
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'FaceRestoration',
'body': {
'image': 'https://image.url'
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'FaceRestoration',
body: {
image: 'https://image.url'
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'FaceRestoration',
'body' => [
'image' => 'https://image.url'
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "FaceRestoration");
JSONObject body = new JSONObject();
body.put("image", "https://image.url");
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "FaceRestoration",
body = new
{
image = "https://image.url"
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "FaceRestoration",
"body": [
"image": "https://image.url"
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"ScratchFix",
@"body": @{
@"image": @"https://image.url"
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "FaceRestoration",
"body": {
"image": "https://image.url"
}
}')
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | FaceRestoration |
| body.image | string | true | an image url |
| body.presigned_url | string | false | a presigned URL generated for temporary upload access to private objects. |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://image.url"
}
}
}

ColorizePhoto
Supported Formats
Currently, the supported file formats are JPG, JPEG, PNG, BMP, WEBP, JFIF, JFI, JPE, JIF.
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'ColorizePhoto',
body: {
image: 'https://image.url'
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'ColorizePhoto',
'body': {
'image': 'https://image.url'
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'ColorizePhoto',
body: {
image: 'https://image.url'
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'ColorizePhoto',
'body' => [
'image' => 'https://image.url'
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "ColorizePhoto");
JSONObject body = new JSONObject();
body.put("image", "https://image.url");
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "ColorizePhoto",
body = new
{
image = "https://image.url"
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "ColorizePhoto",
"body": [
"image": "https://image.url"
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"ColorizePhoto",
@"body": @{
@"image": @"https://image.url"
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "ColorizePhoto",
"body": {
"image": "https://image.url"
}
}')
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | ColorizePhoto |
| body.image | string | true | an image url |
| body.presigned_url | string | false | a presigned URL generated for temporary upload access to private objects. |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://image.url"
}
}
}

BackgroundRemover
Supported Formats
Currently, the supported file formats are JPG, JPEG, PNG, BMP, WEBP, JFIF, JFI, JPE, JIF.
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'BackgroundRemover',
body: {
image: 'https://image.url',
action: 'auto'
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'BackgroundRemover',
'body': {
'image': 'https://image.url',
'action': 'auto'
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'BackgroundRemover',
body: {
image: 'https://image.url',
action: 'auto'
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'BackgroundRemover',
'body' => [
'image' => 'https://image.url',
'action' => 'auto'
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "BackgroundRemover");
JSONObject body = new JSONObject();
body.put("image", "https://image.url");
body.put("action", "auto");
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "BackgroundRemover",
body = new
{
image = "https://image.url",
action = "auto"
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "BackgroundRemover",
"body": [
"image": "https://image.url",
"action": "auto"
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"BackgroundRemover",
@"body": @{
@"image": @"https://image.url",
@"action": @"auto"
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "BackgroundRemover",
"body": {
"image": "https://image.url",
"action": "auto"
}
}')
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | BackgroundRemover |
| body.image | string | true | an image url |
| body.action | string | true | auto |
| body.presigned_url | string | false | a presigned URL generated for temporary upload access to private objects. |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://image.url"
}
}
}

BackgroundChanger
Supported Formats
Currently, the supported file formats are JPG, JPEG, PNG, BMP, WEBP, JFIF, JFI, JPE, JIF.
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'BackgroundChanger',
body: {
image: 'https://image.url',
background: 'https://new.background.url'
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'BackgroundChanger',
'body': {
'image': 'https://image.url',
'background': 'https://new.background.url'
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'BackgroundChanger',
body: {
image: 'https://image.url',
background: 'https://new.background.url'
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'BackgroundChanger',
'body' => [
'image' => 'https://image.url',
'background' => 'https://new.background.url'
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "BackgroundChanger");
JSONObject body = new JSONObject();
body.put("image", "https://image.url");
body.put("background", "https://new.background.url");
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "BackgroundChanger",
body = new
{
image = "https://image.url",
background = "https://new.background.url"
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "BackgroundChanger",
"body": [
"image": "https://image.url",
"background": "https://new.background.url"
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"BackgroundChanger",
@"body": @{
@"image": @"https://image.url",
@"background": @"https://new.background.url"
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "BackgroundChanger",
"body": {
"image": "https://image.url",
"background": "https://new.background.url"
}
}')
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | BackgroundChanger |
| body.image | string | true | an image url |
| body.background | string | true | remove the original background and replace with the new one |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://image.url"
}
}
}

BackgroundGenerator
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'BackgroundGenerator',
body: {
image: 'https://image.url',
prompts: 'input your prompts here',
count: 2
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'BackgroundGenerator',
'body': {
'image': 'https://image.url',
'prompts': 'input your prompts here',
'count': 2
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'BackgroundGenerator',
body: {
image: 'https://image.url',
prompts: 'input your prompts here',
count: 2
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'BackgroundGenerator',
'body' => [
'image' => 'https://image.url',
'prompts' => 'input your prompts here',
'count' => 2
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "BackgroundGenerator");
JSONObject body = new JSONObject();
body.put("image", "https://image.url");
body.put("prompts", "input your prompts here");
body.put("count", 2);
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "BackgroundGenerator",
body = new
{
image = "https://image.url",
prompts = "input your prompts here",
count = 2
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "BackgroundGenerator",
"body": [
"image": "https://image.url",
"prompts": "input your prompts here",
"count": 2
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"BackgroundGenerator",
@"body": @{
@"image": @"https://image.url",
@"prompts": @"input your prompts here",
@"count": @2
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "BackgroundGenerator",
"body": {
"image": "https://image.url",
"prompts": "input your prompts here",
"count": 2
}
}')
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | BackgroundGenerator |
| body.image | string | true | an image url |
| body.count | number | false | the number of result images, maximum is 4, default is 1 |
| body.prompts | string | true | write the description of the background you want to generate, maximum is 200 characters, here we provide a lot of prompts for reference |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"outputs": [
"https://image1.url",
"https://image2.url"
]
}
}
}
FaceAnimation
FaceAnimation:Detection
Supported Formats
Currently, the supported file formats are JPG, JPEG, PNG, BMP, WEBP, JFIF, JFI, JPE, JIF.
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'FaceAnimation:Detection',
body: {
image: 'https://image.url',
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'FaceAnimation:Detection',
'body': {
'image': 'https://image.url',
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'FaceAnimation:Detection',
body: {
image: 'https://image.url',
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'FaceAnimation:Detection',
'body' => [
'image' => 'https://image.url',
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "FaceAnimation:Detection");
JSONObject body = new JSONObject();
body.put("image", "https://image.url");
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "FaceAnimation:Detection",
body = new
{
image = "https://image.url"
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "FaceAnimation:Detection",
"body": [
"image": "https://image.url"
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"FaceAnimation:Detection",
@"body": @{
@"image": @"https://image.url"
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "FaceAnimation:Detection",
"body": {
"image": "https://image.url"
}
}')
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | FaceAnimation:Detection |
| body.image | string | true | an image url |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"face_positions": [
{
"left": 311.2,
"top": 144.8,
"width": 800.8,
"height": 787.4
}
]
}
}
}
FaceAnimation:Generation
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'FaceAnimation:Generation',
body: {
image: 'https://image.url',
face_positions: [
{
left: 311.2,
top: 144.8,
width: 800.8,
height: 787.4
}
]
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'FaceAnimation:Generation',
'body': {
'image': 'https://image.url',
'face_positions': [
{
'left': 311.2,
'top': 144.8,
'width': 800.8,
'height': 787.4
}
]
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'FaceAnimation:Generation',
body: {
image: 'https://image.url',
face_positions: [
{
left: 311.2,
top: 144.8,
width: 800.8,
height: 787.4
}
]
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'FaceAnimation:Generation',
'body' => [
'image' => 'https://image.url',
'face_positions' => [
[
'left' => 311.2,
'top' => 144.8,
'width' => 800.8,
'height' => 787.4
]
]
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
import org.json.JSONArray;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "FaceAnimation:Generation");
JSONObject body = new JSONObject();
body.put("image", "https://image.url");
JSONArray facePositions = new JSONArray();
JSONObject facePosition = new JSONObject();
facePosition.put("left", 311.2);
facePosition.put("top", 144.8);
facePosition.put("width", 800.8);
facePosition.put("height", 787.4);
facePositions.put(facePosition);
body.put("face_positions", facePositions);
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "FaceAnimation:Generation",
body = new
{
image = "https://image.url",
face_positions = new[]
{
new
{
left = 311.2,
top = 144.8,
width = 800.8,
height = 787.4
}
}
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "FaceAnimation:Generation",
"body": [
"image": "https://image.url",
"face_positions": [
[
"left": 311.2,
"top": 144.8,
"width": 800.8,
"height": 787.4
]
]
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"FaceAnimation:Generation",
@"body": @{
@"image": @"https://image.url",
@"face_positions": @[
@{
@"left": @311.2,
@"top": @144.8,
@"width": @800.8,
@"height": @787.4
}
]
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "FaceAnimation:Generation",
"body": {
"image": "https://image.url",
"face_positions": [
{
"left": 311.2,
"top": 144.8,
"width": 800.8,
"height": 787.4
}
]
}
}')
Supported Video File
| Field | Description |
|---|---|
| Format | MP4, MOV, WMV, AVI |
| Duration | Less than 20s |
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | FaceAnimation:Generation |
| body.image | string | true | an image url |
| body.face_positions | Array<{ left, top, width, height }> | true | face positions based on "FaceAnimation:Detection" |
| body.driver_video | string | false | a driver video url, the first frame of the video needs to have facial features. |
| body.presigned_urls | Array<string> | false | a list of presigned URLs generated for temporary upload access to private objects. |
| body.mode | number | false | generating scheme, 0: crop + full, 1: crop, 2: full, default: 1 |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://image.url"
}
}
}

ImageToImage
Supported Formats
Currently, the supported file formats are JPG, JPEG, PNG, BMP, WEBP, JFIF, JFI, JPE, JIF.
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'ImageToImage',
body: {
image: 'https://image.url',
style_id: 'Line_Art_img'
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'ImageToImage',
'body': {
'image': 'https://image.url',
'style_id': 'Line_Art_img'
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'ImageToImage',
body: {
image: 'https://image.url',
style_id: 'Line_Art_img'
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'ImageToImage',
'body' => [
'image' => 'https://image.url',
'style_id' => 'Line_Art_img'
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "ImageToImage");
JSONObject body = new JSONObject();
body.put("image", "https://image.url");
body.put("style_id", "Line_Art_img");
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "ImageToImage",
body = new
{
image = "https://image.url",
style_id = "Line_Art_img"
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "ImageToImage",
"body": [
"image": "https://image.url",
"style_id": "Line_Art_img"
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"ImageToImage",
@"body": @{
@"image": @"https://image.url",
@"style_id": @"Line_Art_img"
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "ImageToImage",
"body": {
"image": "https://image.url",
"style_id": "Line_Art_img"
}
}')
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | ImageToImage |
| body.image | string | true | an image url |
| body.count | number | false | the number of result images, maximum is 100, default is 1 |
| body.style_id | string | true | which style to recreate based on, get all styles via /biz/api/cartoon/styles |
| body.HD | boolean | false | whether to generate HD results, default is false |
| body.presigned_urls | Array<string> | false | a list of presigned URLs generated for temporary upload access to private objects. |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"outputs": [
"https://image1.url",
"https://image2.url"
]
}
}
}

Cartoon
Styles
Query cartoon styles
GET https://api.nero.com/biz/api/cartoon/styles
Response success example
{
"code": 0,
"data": {
"styles": [
{
"id": "Cartoon_img",
"name": "Cartoon",
"image": "https://example.image"
},
{
"id": "Video_Game_img",
"name": "PS2 Game",
"image": "https://example.image"
}
]
}
}
AvatarGenerator
AvatarGeneratorV2
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'AvatarGeneratorV2',
body: {
images: [
'https://image1.url',
'https://image2.url'
],
style_id: "foo",
type: 'female',
count: 5
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'AvatarGeneratorV2',
'body': {
'images': [
'https://image1.url',
'https://image2.url'
],
'style_id': 'foo',
'type': 'female',
'count': 5
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'AvatarGeneratorV2',
body: {
images: [
'https://image1.url',
'https://image2.url'
],
style_id: 'foo',
type: 'female',
count: 5
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'AvatarGeneratorV2',
'body' => [
'images' => [
'https://image1.url',
'https://image2.url'
],
'style_id' => 'foo',
'type' => 'female',
'count' => 5
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "AvatarGeneratorV2");
JSONObject body = new JSONObject();
JSONArray images = new JSONArray();
images.put("https://image1.url");
images.put("https://image2.url");
body.put("images", images);
body.put("style_id", "foo");
body.put("type", "female");
body.put("count", 5);
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "AvatarGeneratorV2",
body = new
{
images = new[]
{
"https://image1.url",
"https://image2.url"
},
style_id = "foo",
type = "female",
count = 5
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "AvatarGeneratorV2",
"body": [
"images": [
"https://image1.url",
"https://image2.url"
],
"style_id": "foo",
"type": "female",
"count": 5
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"AvatarGeneratorV2",
@"body": @{
@"images": @[
@"https://image1.url",
@"https://image2.url"
],
@"style_id": @"foo",
@"type": @"female",
@"count": @5
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "AvatarGeneratorV2",
"body": {
"images": [
"https://image1.url",
"https://image2.url"
],
"style_id": "foo",
"type": "female",
"count": 5
}
}')
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | AvatarGeneratorV2 |
| body.images | Array<string> | true | image urls |
| body.style_id | string | true | you can get style id from avatar API |
| body.type | string | true | male or female |
| body.count | number | false | the number of result images, maximum is 100, default is 1 |
| body.presigned_urls | Array<string> | false | a list of presigned URLs generated for temporary upload access to private objects. |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"outputs": [
"https://image1.url",
"https://image2.url"
]
},
"msg": "the failed image information" // If partially successful, show the failed image information
}
}
![]()
Avatar
Styles
Query avatar styles
GET https://api.nero.com/biz/api/avatar/styles
Response success example
{
"code": 0,
"data": {
"styles": [
{
"style_id": "professional",
"title": "Job",
"description": "Get a professional look with formal headshots.",
"presets": {
"female": 45,
"male": 56
},
"images": [
"https://sample.image1.url",
"https://sample.image2.url"
]
}
]
}
}
ImageToVideo
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'ImageToVideo',
body: {
image: 'https://image.url',
prompts: 'input your prompts here',
resolution: 480
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'ImageToVideo',
'body': {
'image': 'https://image.url',
'prompts': 'input your prompts here',
'resolution': 480
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'ImageToVideo',
body: {
image: 'https://image.url',
prompts: 'input your prompts here',
resolution: 480
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'ImageToVideo',
'body' => [
'image' => 'https://image.url',
'prompts' => 'input your prompts here',
'resolution' => 480
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "ImageToVideo");
JSONObject body = new JSONObject();
body.put("image", "https://image.url");
body.put("prompts", "input your prompts here");
body.put("resolution", 480);
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "ImageToVideo",
body = new
{
image = "https://image.url",
prompts = "input your prompts here",
resolution = 480
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "ImageToVideo",
"body": [
"image": "https://image.url",
"prompts": "input your prompts here",
"resolution": 480
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"ImageToVideo",
@"body": @{
@"image": @"https://image.url",
@"prompts": @"input your prompts here",
@"resolution": @480
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "ImageToVideo",
"body": {
"image": "https://image.url",
"prompts": "input your prompts here",
"resolution": 480
}
}')
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | ImageToVideo |
| body.image | string | true | an image url |
| body.prompts | string | false | write the description of the animation you want to generate, maximum is 200 characters |
| body.resolution | number | false | output resolution, 480 or 720, default is 480 |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://video.url"
}
}
}
ImageCompressor
Supported Formats
Currently, the supported file formats are JPG, JPEG, PNG, BMP, WEBP, GIF, JFIF, JFI, JPE, JIF and SVG.
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'ImageCompressor',
body: {
image: 'https://image.url'
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'ImageCompressor',
'body': {
'image': 'https://image.url'
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'ImageCompressor',
body: {
image: 'https://image.url'
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'ImageCompressor',
'body' => [
'image' => 'https://image.url'
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "ImageCompressor");
JSONObject body = new JSONObject();
body.put("image", "https://image.url");
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "ImageCompressor",
body = new
{
image = "https://image.url"
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "ImageCompressor",
"body": [
"image": "https://image.url"
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"ImageCompressor",
@"body": @{
@"image": @"https://image.url"
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "ImageCompressor",
"body": {
"image": "https://image.url"
}
}')
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | ImageCompressor |
| body.image | string | true | an image url |
| body.presigned_url | string | false | a presigned URL generated for temporary upload access to private objects. |
| body.strategy | string | false | "high" "mid" two compression rate, default is "high", one is higher, may cause image quality loss, one is lower, the file size may be larger. |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://image.url",
"ratio": 1.52, // ratio = size_in / size_out
"size_in": 139144,
"size_out": 91267
}
}
}

ObjectCounter
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'ObjectCounter',
body: {
image: 'https://image.url',
guide_bboxes: [[[160,41], [251,258]], [[534,190], [605,257]], [[345,467], [413,562]]]
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'ObjectCounter',
'body': {
'image': 'https://image.url',
'guide_bboxes': [[[160, 41], [251, 258]], [[534, 190], [605, 257]], [[345, 467], [413, 562]]]
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'ObjectCounter',
body: {
image: 'https://image.url',
guide_bboxes: [[[160, 41], [251, 258]], [[534, 190], [605, 257]], [[345, 467], [413, 562]]]
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'ObjectCounter',
'body' => [
'image' => 'https://image.url',
'guide_bboxes' => [
[[160, 41], [251, 258]],
[[534, 190], [605, 257]],
[[345, 467], [413, 562]]
]
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "ObjectCounter");
JSONObject body = new JSONObject();
body.put("image", "https://image.url");
JSONArray guideBboxes = new JSONArray();
// First bbox: [[160, 41], [251, 258]]
JSONArray bbox1 = new JSONArray();
JSONArray point1_1 = new JSONArray();
point1_1.put(160);
point1_1.put(41);
JSONArray point1_2 = new JSONArray();
point1_2.put(251);
point1_2.put(258);
bbox1.put(point1_1);
bbox1.put(point1_2);
// Second bbox: [[534, 190], [605, 257]]
JSONArray bbox2 = new JSONArray();
JSONArray point2_1 = new JSONArray();
point2_1.put(534);
point2_1.put(190);
JSONArray point2_2 = new JSONArray();
point2_2.put(605);
point2_2.put(257);
bbox2.put(point2_1);
bbox2.put(point2_2);
// Third bbox: [[345, 467], [413, 562]]
JSONArray bbox3 = new JSONArray();
JSONArray point3_1 = new JSONArray();
point3_1.put(345);
point3_1.put(467);
JSONArray point3_2 = new JSONArray();
point3_2.put(413);
point3_2.put(562);
bbox3.put(point3_1);
bbox3.put(point3_2);
guideBboxes.put(bbox1);
guideBboxes.put(bbox2);
guideBboxes.put(bbox3);
body.put("guide_bboxes", guideBboxes);
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "ObjectCounter",
body = new
{
image = "https://image.url",
guide_bboxes = new[]
{
new[] { new[] { 160, 41 }, new[] { 251, 258 } },
new[] { new[] { 534, 190 }, new[] { 605, 257 } },
new[] { new[] { 345, 467 }, new[] { 413, 562 } }
}
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "ObjectCounter",
"body": [
"image": "https://image.url",
"guide_bboxes": [
[[160, 41], [251, 258]],
[[534, 190], [605, 257]],
[[345, 467], [413, 562]]
]
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"ObjectCounter",
@"body": @{
@"image": @"https://image.url",
@"guide_bboxes": @[
@[@[@160, @41], @[@251, @258]],
@[@[@534, @190], @[@605, @257]],
@[@[@345, @467], @[@413, @562]]
]
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "ObjectCounter",
"body": {
"image": "https://image.url",
"guide_bboxes": [[[160,41], [251,258]], [[534,190], [605,257]], [[345,467], [413,562]]]
}
}')
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | ObjectCounter |
| body.image | string | true | an image url |
| body.guide_bboxes | Array<Array<Array<number>>> | false | 3 set of coordinates of left_top(lt) and right_bottom(rb) points, order: [[[lt_x1, lt_y1], [rb_x1, rb_y1]], [[lt_x2, lt_y2], [rb_x2, rb_y3]], [[lt_x3, lt_y3], [rb_x3, rb_y3]]] |
| body.threshold | number | false | confidence threshold, effective interval [0, 255], default value: 50 |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://image1.url",
"obj_num": 5,
"center_coords": [[x1, y1], [x2, y2], ...[x5, y5]] // coordinates per object
}
}
}
FaceDetection
Request example
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'FaceDetection',
body: {
images: [
'https://image1.url',
'https://image2.url'
]
},
},
})
import requests
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'FaceDetection',
'body': {
'images': [
'https://image1.url',
'https://image2.url'
]
},
}
)
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'FaceDetection',
body: {
images: [
'https://image1.url',
'https://image2.url'
]
}
}.to_json
response = http.request(request)
<?php
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'FaceDetection',
'body' => [
'images' => [
'https://image1.url',
'https://image2.url'
]
],
]));
$response = curl_exec($ch);
curl_close($ch);
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "FaceDetection");
JSONObject body = new JSONObject();
JSONArray images = new JSONArray();
images.put("https://image1.url");
images.put("https://image2.url");
body.put("images", images);
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "FaceDetection",
body = new
{
images = new[]
{
"https://image1.url",
"https://image2.url"
}
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
}
}
}
import Foundation
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "FaceDetection",
"body": [
"images": [
"https://image1.url",
"https://image2.url"
]
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"FaceDetection",
@"body": @{
@"images": @[
@"https://image1.url",
@"https://image2.url"
]
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
}
return 0;
}
#!/bin/bash
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "FaceDetection",
"body": {
"images": [
"https://image1.url",
"https://image2.url"
]
}
}')
Headers
| Field | Description |
|---|---|
| x-neroai-api-key | your API key |
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | true | FaceDetection |
| body.images | Array<string> | true | image urls |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"outputs": [
{
"filename": "foo.png",
"code": 0 // face detection passed
},
{
"filename": "bar.png",
"code": 105 // if code > 0, it means that the face detection unpassed
}
]
}
}
}
API key
Info
Query your API key info
GET https://api.nero.com/biz/api/apikey?key=
Response success example
{
"code": 0,
"data": {
"status": "valid",
"expired_at": "2099-01-01 00:00:00",
"remaining_credits": 100
}
}
Replace
Replace your API key
PUT https://api.nero.com/biz/api/apikey/replace
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| key | string | true | your API key |
Response success example
{
"code": 0,
"data": {
"key: "new API key"
}
}
Rate limit
APIs starting with /biz/api/task are rate limited to 10 times per second.
If this rate is exceeded, the request will receive http status code 429 with error message "Too Many Requests".
Image URL & File Upload
The API supports two methods for providing images as input when creating a task:
Image URL Input You can supply a publicly accessible image URL in the request body. In this case, the request uses a JSON content type and the API fetches the image from the provided link for processing.
Local File Upload You can upload image files directly from your local device. Local file upload requires the request to use the HTTP
multipart/form-dataformat. Each uploaded file must not exceed 50 MB in size. The correct multipart form headers (including boundary) must be set; otherwise, the API will return an error.
Both methods allow the API to receive and process the image for the selected task. The image URL approach is convenient when the image is already hosted online, while local file upload lets you send images directly from your local system using multipart form-data.
// 1. local files
const axios = require('axios')
const FormData = require('form-data')
const fs = require('fs')
const data = new FormData()
const payload = {
type: 'ImageUpscaler:Standard',
body: {
// ignore "image", replace with local file
// image: 'https://image.url',
upscaling_rate: 2,
// ...
},
}
data.append('payload', JSON.stringify(payload))
data.append('file', fs.createReadStream('/local/file/path'))
axios({
method: 'POST',
url: 'https://api.nero.com/biz/api/task',
headers: {
'x-neroai-api-key': 'your API key',
...data.getHeaders(),
},
data,
}).then(response => {
console.log(response)
}).catch(error => {
console.log(error)
})
// 2. file links
const axios = require('axios')
const data = {
type: 'ImageUpscaler:Standard',
body: {
// using file link
image: 'https://image.url',
upscaling_rate: 2,
// ...
},
}
axios({
method: 'POST',
url: 'https://api.nero.com/biz/api/task',
headers: {
'x-neroai-api-key': 'your API key',
},
data,
}).then(response => {
console.log(response)
}).catch(error => {
console.log(error)
})
import requests
import json
# 1. Upload local file
files = {
'file': open('/local/file/path', 'rb')
}
payload_data = {
'type': 'ImageUpscaler:Standard',
'body': {
# ignore "image", replace with local file
# 'image': 'https://image.url',
'upscaling_rate': 2,
# ...
}
}
data = {
'payload': json.dumps(payload_data)
}
try:
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'your API key'
},
files=files,
data=data
)
print(response.json())
except Exception as error:
print(error)
finally:
files['file'].close()
# 2. File links
data = {
'type': 'ImageUpscaler:Standard',
'body': {
# using file link
'image': 'https://image.url',
'upscaling_rate': 2,
# ...
}
}
try:
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'your API key'
},
json=data
)
print(response.json())
except Exception as error:
print(error)
require 'net/http'
require 'json'
require 'uri'
require 'mime/types'
# 1. Upload local file
def build_multipart_form(payload_data, file_path)
boundary = "----WebKitFormBoundary#{Time.now.to_i}"
body = []
body << "--#{boundary}\r\n"
body << "Content-Disposition: form-data; name=\"payload\"\r\n\r\n"
body << payload_data.to_json
body << "\r\n"
body << "--#{boundary}\r\n"
body << "Content-Disposition: form-data; name=\"file\"; filename=\"#{File.basename(file_path)}\"\r\n"
body << "Content-Type: application/octet-stream\r\n\r\n"
[body.join, boundary, file_path]
end
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
payload_data = {
type: 'ImageUpscaler:Standard',
body: {
# ignore "image", replace with local file
# image: 'https://image.url',
upscaling_rate: 2,
# ...
}
}
body_start, boundary, file_path = build_multipart_form(payload_data, '/local/file/path')
file_data = File.read(file_path)
body_end = "\r\n--#{boundary}--\r\n"
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'your API key'
request['Content-Type'] = "multipart/form-data; boundary=#{boundary}"
begin
request.body = body_start + file_data + body_end
response = http.request(request)
puts JSON.parse(response.body)
rescue => error
puts error
end
# 2. File links
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'your API key'
request['Content-Type'] = 'application/json'
request.body = {
type: 'ImageUpscaler:Standard',
body: {
# using file link
image: 'https://image.url',
upscaling_rate: 2,
# ...
}
}.to_json
begin
response = http.request(request)
puts JSON.parse(response.body)
rescue => error
puts error
end
<?php
// 1. Upload local file
$ch = curl_init('https://api.nero.com/biz/api/task');
$payload = [
'type' => 'ImageUpscaler:Standard',
'body' => [
// ignore "image", replace with local file
// 'image' => 'https://image.url',
'upscaling_rate' => 2,
// ...
]
];
$file = new CURLFile('/local/file/path');
$data = [
'payload' => json_encode($payload),
'file' => $file
];
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: your API key'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo curl_error($ch);
} else {
echo json_decode($response, true);
}
curl_close($ch);
// 2. File links
$ch = curl_init('https://api.nero.com/biz/api/task');
$data = [
'type' => 'ImageUpscaler:Standard',
'body' => [
// using file link
'image' => 'https://image.url',
'upscaling_rate' => 2,
// ...
]
];
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: your API key',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo curl_error($ch);
} else {
echo json_decode($response, true);
}
curl_close($ch);
?>
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCodeFileUpload {
// 1. Upload local file
public static void uploadFile() throws Exception {
String boundary = "----WebKitFormBoundary" + System.currentTimeMillis();
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "your API key");
conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary);
conn.setDoOutput(true);
JSONObject payload = new JSONObject();
payload.put("type", "ImageUpscaler:Standard");
JSONObject body = new JSONObject();
// ignore "image", replace with local file
// body.put("image", "https://image.url");
body.put("upscaling_rate", 2);
payload.put("body", body);
try (OutputStream os = conn.getOutputStream();
PrintWriter writer = new PrintWriter(new OutputStreamWriter(os, StandardCharsets.UTF_8), true)) {
writer.append("--").append(boundary).append("\r\n");
writer.append("Content-Disposition: form-data; name=\"payload\"").append("\r\n");
writer.append("Content-Type: text/plain; charset=UTF-8").append("\r\n");
writer.append("\r\n");
writer.append(payload.toString()).append("\r\n");
writer.flush();
writer.append("--").append(boundary).append("\r\n");
writer.append("Content-Disposition: form-data; name=\"file\"; filename=\"").append(new File("/local/file/path").getName()).append("\"").append("\r\n");
writer.append("Content-Type: application/octet-stream").append("\r\n");
writer.append("\r\n");
writer.flush();
try (FileInputStream fis = new FileInputStream("/local/file/path")) {
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = fis.read(buffer)) != -1) {
os.write(buffer, 0, bytesRead);
}
os.flush();
}
writer.append("\r\n");
writer.append("--").append(boundary).append("--").append("\r\n");
writer.flush();
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
System.out.println(response.toString());
}
// 2. File links
public static void useFileLink() throws Exception {
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "your API key");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject data = new JSONObject();
data.put("type", "ImageUpscaler:Standard");
JSONObject body = new JSONObject();
// using file link
body.put("image", "https://image.url");
body.put("upscaling_rate", 2);
data.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = data.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
System.out.println(response.toString());
}
public static void main(String[] args) {
try {
uploadFile();
useFileLink();
} catch (Exception e) {
System.out.println(e);
}
}
}
using System;
using System.IO;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCodeFileUpload
{
// 1. Upload local file
static async Task UploadFile()
{
using (var client = new HttpClient())
using (var formData = new MultipartFormDataContent())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "your API key");
var payload = new
{
type = "ImageUpscaler:Standard",
body = new
{
// ignore "image", replace with local file
// image = "https://image.url",
upscaling_rate = 2
// ...
}
};
var payloadJson = JsonSerializer.Serialize(payload);
formData.Add(new StringContent(payloadJson), "payload");
var fileContent = new ByteArrayContent(File.ReadAllBytes("/local/file/path"));
fileContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream");
formData.Add(fileContent, "file", Path.GetFileName("/local/file/path"));
try
{
var response = await client.PostAsync("https://api.nero.com/biz/api/task", formData);
var responseContent = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseContent);
}
catch (Exception error)
{
Console.WriteLine(error);
}
}
}
// 2. File links
static async Task UseFileLink()
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("x-neroai-api-key", "your API key");
var data = new
{
type = "ImageUpscaler:Standard",
body = new
{
// using file link
image = "https://image.url",
upscaling_rate = 2
// ...
}
};
var json = JsonSerializer.Serialize(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
try
{
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseContent);
}
catch (Exception error)
{
Console.WriteLine(error);
}
}
}
static async Task Main(string[] args)
{
await UploadFile();
await UseFileLink();
}
}
import Foundation
// 1. Upload local file
func uploadFile() {
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("your API key", forHTTPHeaderField: "x-neroai-api-key")
let boundary = UUID().uuidString
request.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")
var body = Data()
let payload: [String: Any] = [
"type": "ImageUpscaler:Standard",
"body": [
// ignore "image", replace with local file
// "image": "https://image.url",
"upscaling_rate": 2
// ...
]
]
let payloadJson = try? JSONSerialization.data(withJSONObject: payload)
let payloadString = String(data: payloadJson!, encoding: .utf8)!
body.append("--\(boundary)\r\n".data(using: .utf8)!)
body.append("Content-Disposition: form-data; name=\"payload\"\r\n\r\n".data(using: .utf8)!)
body.append(payloadString.data(using: .utf8)!)
body.append("\r\n".data(using: .utf8)!)
body.append("--\(boundary)\r\n".data(using: .utf8)!)
body.append("Content-Disposition: form-data; name=\"file\"; filename=\"\(URL(fileURLWithPath: "/local/file/path").lastPathComponent)\"\r\n".data(using: .utf8)!)
body.append("Content-Type: application/octet-stream\r\n\r\n".data(using: .utf8)!)
if let fileData = try? Data(contentsOf: URL(fileURLWithPath: "/local/file/path")) {
body.append(fileData)
}
body.append("\r\n--\(boundary)--\r\n".data(using: .utf8)!)
request.httpBody = body
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print(error)
} else if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
}
// 2. File links
func useFileLink() {
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("your API key", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let data: [String: Any] = [
"type": "ImageUpscaler:Standard",
"body": [
// using file link
"image": "https://image.url",
"upscaling_rate": 2
// ...
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: data)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print(error)
} else if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
RunLoop.main.run()
}
uploadFile()
useFileLink()
#import <Foundation/Foundation.h>
// 1. Upload local file
void uploadFile() {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"your API key" forHTTPHeaderField:@"x-neroai-api-key"];
NSString *boundary = [[NSUUID UUID] UUIDString];
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary];
[request setValue:contentType forHTTPHeaderField:@"Content-Type"];
NSDictionary *payload = @{
@"type": @"ImageUpscaler:Standard",
@"body": @{
// ignore "image", replace with local file
// @"image": @"https://image.url",
@"upscaling_rate": @2
// ...
}
};
NSError *error;
NSData *payloadJson = [NSJSONSerialization dataWithJSONObject:payload options:0 error:&error];
NSString *payloadString = [[NSString alloc] initWithData:payloadJson encoding:NSUTF8StringEncoding];
NSMutableData *body = [NSMutableData data];
NSString *filePath = @"/local/file/path";
NSData *fileData = [NSData dataWithContentsOfFile:filePath];
NSString *fileName = [filePath lastPathComponent];
[body appendData:[[NSString stringWithFormat:@"--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"payload\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[payloadString dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"file\"; filename=\"%@\"\r\n", fileName] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[@"Content-Type: application/octet-stream\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:fileData];
[body appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"--%@--\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:body];
NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"%@", responseString);
}
}];
[task resume];
}
// 2. File links
void useFileLink() {
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"your API key" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *data = @{
@"type": @"ImageUpscaler:Standard",
@"body": @{
// using file link
@"image": @"https://image.url",
@"upscaling_rate": @2
// ...
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:data options:0 error:&error];
[request setHTTPBody:jsonData];
NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"%@", responseString);
}
}];
[task resume];
}
int main(int argc, const char * argv[]) {
@autoreleasepool {
uploadFile();
useFileLink();
[[NSRunLoop currentRunLoop] run];
}
return 0;
}
#!/bin/bash
# 1. Upload local file
PAYLOAD='{"type":"ImageUpscaler:Standard","body":{"upscaling_rate":2}}'
curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: your API key' \
-F "payload=$PAYLOAD" \
-F "file=@/local/file/path"
# 2. File links
curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: your API key' \
-H 'Content-Type: application/json' \
-d '{
"type": "ImageUpscaler:Standard",
"body": {
"image": "https://image.url",
"upscaling_rate": 2
}
}'
Sample Code
const axios = require('axios')
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'POST',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
data: {
type: 'ImageUpscaler:Standard',
body: {
image: 'https://image.url',
},
},
})
const { code, data } = result.data
if (code === 0) {
const { task_id } = data
const result = await axios({
url: 'https://api.nero.com/biz/api/task',
method: 'GET',
headers: {
'x-neroai-api-key': 'YOUR_API_KEY'
},
params: {
task_id,
},
})
/* The result maybe
// pending
{
"code": 0,
"data": {
"status": "pending",
"pending_count": 5
}
}
// running
{
"code": 0,
"data": {
"status": "running",
"progress": 99
}
}
// done
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://image.url"
}
}
}
// failed
{
"code": 0,
"data": {
"status": "failed",
"msg": "error message"
}
}
*/
}
import requests
# Create task
response = requests.post(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
json={
'type': 'ImageUpscaler:Standard',
'body': {
'image': 'https://image.url',
},
}
)
result = response.json()
code = result.get('code')
data = result.get('data')
if code == 0:
task_id = data.get('task_id')
# Query task status
response = requests.get(
'https://api.nero.com/biz/api/task',
headers={
'x-neroai-api-key': 'YOUR_API_KEY'
},
params={
'task_id': task_id,
}
)
result = response.json()
# The result maybe
# pending
# {
# "code": 0,
# "data": {
# "status": "pending",
# "pending_count": 5
# }
# }
# running
# {
# "code": 0,
# "data": {
# "status": "running",
# "progress": 99
# }
# }
# done
# {
# "code": 0,
# "data": {
# "status": "done",
# "result": {
# "output": "https://image.url"
# }
# }
# }
# failed
# {
# "code": 0,
# "data": {
# "status": "failed",
# "msg": "error message"
# }
# }
require 'net/http'
require 'json'
require 'uri'
# Create task
uri = URI('https://api.nero.com/biz/api/task')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
type: 'ImageUpscaler:Standard',
body: {
image: 'https://image.url',
}
}.to_json
response = http.request(request)
result = JSON.parse(response.body)
code = result['code']
data = result['data']
if code == 0
task_id = data['task_id']
# Query task status
uri = URI('https://api.nero.com/biz/api/task')
uri.query = URI.encode_www_form({ task_id: task_id })
request = Net::HTTP::Get.new(uri)
request['x-neroai-api-key'] = 'YOUR_API_KEY'
response = http.request(request)
result = JSON.parse(response.body)
# The result maybe
# pending
# {
# "code": 0,
# "data": {
# "status": "pending",
# "pending_count": 5
# }
# }
# running
# {
# "code": 0,
# "data": {
# "status": "running",
# "progress": 99
# }
# }
# done
# {
# "code": 0,
# "data": {
# "status": "done",
# "result": {
# "output": "https://image.url"
# }
# }
# }
# failed
# {
# "code": 0,
# "data": {
# "status": "failed",
# "msg": "error message"
# }
# }
end
<?php
// Create task
$ch = curl_init('https://api.nero.com/biz/api/task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'ImageUpscaler:Standard',
'body' => [
'image' => 'https://image.url',
],
]));
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
$code = $result['code'];
$data = $result['data'];
if ($code == 0) {
$task_id = $data['task_id'];
// Query task status
$url = 'https://api.nero.com/biz/api/task?' . http_build_query(['task_id' => $task_id]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-neroai-api-key: YOUR_API_KEY'
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
/* The result maybe
// pending
{
"code": 0,
"data": {
"status": "pending",
"pending_count": 5
}
}
// running
{
"code": 0,
"data": {
"status": "running",
"progress": 99
}
}
// done
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://image.url"
}
}
}
// failed
{
"code": 0,
"data": {
"status": "failed",
"msg": "error message"
}
}
*/
}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.json.JSONObject;
public class ExampleCode {
public static void main(String[] args) throws Exception {
// Create task
URL url = new URL("https://api.nero.com/biz/api/task");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject requestBody = new JSONObject();
requestBody.put("type", "ImageUpscaler:Standard");
JSONObject body = new JSONObject();
body.put("image", "https://image.url");
requestBody.put("body", body);
try (OutputStream os = conn.getOutputStream()) {
byte[] input = requestBody.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject result = new JSONObject(response.toString());
int code = result.getInt("code");
JSONObject data = result.getJSONObject("data");
if (code == 0) {
String taskId = data.getString("task_id");
// Query task status
String query = "task_id=" + URLEncoder.encode(taskId, StandardCharsets.UTF_8);
URL statusUrl = new URL("https://api.nero.com/biz/api/task?" + query);
HttpURLConnection statusConn = (HttpURLConnection) statusUrl.openConnection();
statusConn.setRequestMethod("GET");
statusConn.setRequestProperty("x-neroai-api-key", "YOUR_API_KEY");
BufferedReader statusBr = new BufferedReader(
new InputStreamReader(statusConn.getInputStream(), StandardCharsets.UTF_8)
);
StringBuilder statusResponse = new StringBuilder();
String statusLine;
while ((statusLine = statusBr.readLine()) != null) {
statusResponse.append(statusLine.trim());
}
JSONObject statusResult = new JSONObject(statusResponse.toString());
/* The result maybe
// pending
{
"code": 0,
"data": {
"status": "pending",
"pending_count": 5
}
}
// running
{
"code": 0,
"data": {
"status": "running",
"progress": 99
}
}
// done
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://image.url"
}
}
}
// failed
{
"code": 0,
"data": {
"status": "failed",
"msg": "error message"
}
}
*/
}
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class ExampleCode
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
// Create task
client.DefaultRequestHeaders.Add("x-neroai-api-key", "YOUR_API_KEY");
var requestBody = new
{
type = "ImageUpscaler:Standard",
body = new
{
image = "https://image.url"
}
};
var json = JsonSerializer.Serialize(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.nero.com/biz/api/task", content);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseContent);
var code = result.GetProperty("code").GetInt32();
var data = result.GetProperty("data");
if (code == 0)
{
var taskId = data.GetProperty("task_id").GetString();
// Query task status
var statusUrl = $"https://api.nero.com/biz/api/task?task_id={Uri.EscapeDataString(taskId)}";
var statusResponse = await client.GetAsync(statusUrl);
var statusContent = await statusResponse.Content.ReadAsStringAsync();
var statusResult = JsonSerializer.Deserialize<JsonElement>(statusContent);
/* The result maybe
// pending
{
"code": 0,
"data": {
"status": "pending",
"pending_count": 5
}
}
// running
{
"code": 0,
"data": {
"status": "running",
"progress": 99
}
}
// done
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://image.url"
}
}
}
// failed
{
"code": 0,
"data": {
"status": "failed",
"msg": "error message"
}
}
*/
}
}
}
}
import Foundation
// Create task
let url = URL(string: "https://api.nero.com/biz/api/task")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"type": "ImageUpscaler:Standard",
"body": [
"image": "https://image.url"
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: requestBody)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data,
let result = try? JSONSerialization.jsonObject(with: data) as? [String: Any],
let code = result["code"] as? Int,
let dataDict = result["data"] as? [String: Any],
code == 0,
let taskId = dataDict["task_id"] as? String else {
return
}
// Query task status
var components = URLComponents(string: "https://api.nero.com/biz/api/task")!
components.queryItems = [URLQueryItem(name: "task_id", value: taskId)]
var statusRequest = URLRequest(url: components.url!)
statusRequest.httpMethod = "GET"
statusRequest.setValue("YOUR_API_KEY", forHTTPHeaderField: "x-neroai-api-key")
let statusTask = URLSession.shared.dataTask(with: statusRequest) { statusData, statusResponse, statusError in
guard let statusData = statusData,
let statusResult = try? JSONSerialization.jsonObject(with: statusData) as? [String: Any] else {
return
}
// The result maybe
// pending
// {
// "code": 0,
// "data": {
// "status": "pending",
// "pending_count": 5
// }
// }
// running
// {
// "code": 0,
// "data": {
// "status": "running",
// "progress": 99
// }
// }
// done
// {
// "code": 0,
// "data": {
// "status": "done",
// "result": {
// "output": "https://image.url"
// }
// }
// }
// failed
// {
// "code": 0,
// "data": {
// "status": "failed",
// "msg": "error message"
// }
// }
}
statusTask.resume()
}
task.resume()
RunLoop.main.run()
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
// Create task
NSURL *url = [NSURL URLWithString:@"https://api.nero.com/biz/api/task"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *requestBody = @{
@"type": @"ImageUpscaler:Standard",
@"body": @{
@"image": @"https://image.url"
}
};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:requestBody
options:0
error:&error];
[request setHTTPBody:jsonData];
NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
return;
}
NSDictionary *result = [NSJSONSerialization JSONObjectWithData:data
options:0
error:&error];
NSNumber *code = result[@"code"];
NSDictionary *dataDict = result[@"data"];
if ([code intValue] == 0) {
NSString *taskId = dataDict[@"task_id"];
// Query task status
NSString *queryString = [NSString stringWithFormat:@"task_id=%@",
[taskId stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]];
NSString *statusUrlString = [NSString stringWithFormat:@"https://api.nero.com/biz/api/task?%@", queryString];
NSURL *statusUrl = [NSURL URLWithString:statusUrlString];
NSMutableURLRequest *statusRequest = [NSMutableURLRequest requestWithURL:statusUrl];
[statusRequest setHTTPMethod:@"GET"];
[statusRequest setValue:@"YOUR_API_KEY" forHTTPHeaderField:@"x-neroai-api-key"];
NSURLSessionDataTask *statusTask = [[NSURLSession sharedSession] dataTaskWithRequest:statusRequest
completionHandler:^(NSData *statusData, NSURLResponse *statusResponse, NSError *statusError) {
if (statusError) {
return;
}
NSDictionary *statusResult = [NSJSONSerialization JSONObjectWithData:statusData
options:0
error:&error];
/* The result maybe
// pending
{
"code": 0,
"data": {
"status": "pending",
"pending_count": 5
}
}
// running
{
"code": 0,
"data": {
"status": "running",
"progress": 99
}
}
// done
{
"code": 0,
"data": {
"status": "done",
"result": {
"output": "https://image.url"
}
}
}
// failed
{
"code": 0,
"data": {
"status": "failed",
"msg": "error message"
}
}
*/
}];
[statusTask resume];
}
}];
[task resume];
[[NSRunLoop currentRunLoop] run];
}
return 0;
}
#!/bin/bash
# Create task
RESPONSE=$(curl -X POST 'https://api.nero.com/biz/api/task' \
-H 'x-neroai-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "ImageUpscaler:Standard",
"body": {
"image": "https://image.url"
}
}')
# Extract task_id (requires jq for JSON parsing)
TASK_ID=$(echo $RESPONSE | jq -r '.data.task_id')
CODE=$(echo $RESPONSE | jq -r '.code')
if [ "$CODE" == "0" ]; then
# Query task status
curl -X GET "https://api.nero.com/biz/api/task?task_id=$TASK_ID" \
-H 'x-neroai-api-key: YOUR_API_KEY'
# The result maybe
# pending
# {
# "code": 0,
# "data": {
# "status": "pending",
# "pending_count": 5
# }
# }
# running
# {
# "code": 0,
# "data": {
# "status": "running",
# "progress": 99
# }
# }
# done
# {
# "code": 0,
# "data": {
# "status": "done",
# "result": {
# "output": "https://image.url"
# }
# }
# }
# failed
# {
# "code": 0,
# "data": {
# "status": "failed",
# "msg": "error message"
# }
# }
fi
Create a task
POST https://api.nero.com/biz/api/task
Query task result
GET https://api.nero.com/biz/api/task?task_id=
Errors
We will return a standard http response. For business errors, we return error information in the response body with http status code 200, and we return error with http status code 5xx only when an unpredictable exception occurs on the server.
The Nero AI API uses the following error codes.
| Code | Meaning |
|---|---|
| 11002 | The API key is invalid |
| 11003 | The API key is expired |
| 11004 | The remaining credits of API key are insufficient |
Response error example
{
"code": 11002,
"msg": "The API key is invalid, xxxxxx"
}
Prompts
BackgroundChanger/Generator Prompts Group 1
Product
- Name: Marble
Prompt: luxury white marble table with soft gray veining, soft natural light from the left, blurred white wall in background, minimal lifestyle interior, high realism, shallow depth of field
- Name: Wood
Prompt: wooden table surface with warm sunlight casting soft shadows, minimalistic neutral gray wall in background, cozy indoor lighting, natural texture, depth of field
- Name: Leaf
Prompt: black tabletop with soft reflections, (monstera leaf) behind the product, soft marble wall, soft natural light, minimalist realistic indoor scene, shallow depth of field
- Name: Silk
Prompt: a product placed on soft silver satin fabric with natural folds, background also draped with matching silver fabric, soft natural lighting, minimal and high-end scene, clean and realistic
- Name: Beach
Prompt: a product placed on soft sand at the beach, with gentle ocean waves and clear sky in the background, soft natural sunlight, minimalist and realistic lifestyle scene, no clutter, high-end aesthetic
- Name: Floral Nest
Prompt: a product placed on a light rattan or wooden table in a cozy home setting, with white flowers and soft natural light, blurred pillows and furniture in the background, clean and minimal, high realism
- Name: Houseplants
Prompt: On a white marble pedestal stand. The background is a minimalist studio setting with foliage plants. Overhead shot, soft, natural lighting, studio product photography.
- Name: Crisp
Prompt: Clear blue water with natural ripples, soft reflections and bright lighting.
- Name: Rosemist
Prompt: On a wooden surface, surrounded by fresh dewdrop-covered roses and eucalyptus leaves, soft light and blurred green garden background.
- Name: Premium
Prompt: Displayed on a sleek presentation surface with subtle gold accents, set against a minimalist background with soft, diffused lighting to create a luxurious, high-end atmosphere.
- Name: Blackcloth
Prompt: On soft black satin fabric with natural folds, background also draped with matching black satin fabric, soft natural lighting, minimal and high-end scene, clean and realistic.
- Name: Concrete
Prompt: On a smooth, dark grey concrete surface, soft shadows, clean lighting, seamless grey background, studio shot.
- Name: Walnut
Prompt: On a dark wood table with rich grain, soft warm lighting, and dark wood background. Clean and moody.
- Name: Bokeh
Prompt: On a glossy surface. Soft golden lights and blurred bokeh backdrop.
- Name: Tropical
Prompt: On wet stone with tropical flowers like hibiscus and plumeria around it, sunlit water droplets and palm leaf shadows in the background.
- Name: Green Velvet
Prompt: On a table with dark green velvet cover, matching a velvet curtain backdrop, under soft dramatic lighting.
- Name: Vintage
Prompt: On an antique wooden table, surrounded by stacked books and delicate vintage objects, soft golden hour light filters through lace curtains, evoking a refined and nostalgic aesthetic.
- Name: Mirror
Prompt: On a mirrored stand with soft reflections, set against a minimal gradient backdrop and ambient lighting. The scene blends naturally with the product, highlighting its modern elegance.
- Name: Clean
Prompt: Minimalist white studio background with soft shadows, subtle gradient lighting, and a smooth reflective surface to highlight product contours. Clean, distraction-free, seamless professional look.
- Name: Gold Fabric
Prompt: On soft beige satin fabric with natural folds, background also draped with matching light beige satin fabric, soft natural lighting, minimal and high-end scene, clean and realistic.
- Name: Bagstage
Prompt: Luxury boutique counter with marble, dark wood, and warm lighting. Minimal, elegant setting to highlight premium handbags with style and sophistication.
Portrait
- Name: Brick
Prompt: in front of a white brick wall with soft natural lighting
- Name: Sea
Prompt: portrait on a beach with wide blue sea and clear blue sky, daylight
- Name: Bistro
Prompt: in a softly lit bistro with string lights and a cozy atmosphere
- Name: Japanese Room
Prompt: inside a traditional Japanese tea room with wooden panels, tatami mats, and natural window light
- Name: Balcony
Prompt: standing on a small Parisian balcony with wrought iron railing, Haussmann buildings and skyline in the background, golden hour lighting
- Name: Plant
Prompt: next to a large window with indoor plants and soft daylight
BackgroundChanger/Generator Prompts Group 2
Product
Name: Seaside
Prompt: Mediterranean coast, turquoise ocean with sunlight, rocky cliffs, sailboat, stone terrace, yellow wildflowers, sunny luxury vacation scene
Name: Lily
Prompt: Soft beige background with vibrant orange lily flowers, natural driftwood piece, warm summer aesthetic, botanical product photography, gentle lighting, elegant minimalist scene, subtle shadows
Name: Wooden
Prompt: Modern minimalist interior, warm beige wooden shelving unit with books and ceramic vases, tropical green plants, natural wood cabinet, soft window light, cozy home decor
Name: Shelf
Prompt: Clean retail shelf and counter display, neutral background, soft even lighting, realistic materials, minimal distractions, suitable for product presentation
Name: Magazine
Prompt: High-end magazine cover background for product photography, clean elegant composition, soft lighting, premium textures, realistic studio look, cinematic style, single title text “Fashion” only
Name: Bed
Prompt: Cozy bedroom scene, unmade bed with cream white sheets and blue denim clothing, soft natural morning light, casual lifestyle photography, warm beige tones, relaxed atmosphere
Name: Snow
Prompt: Displayed in a softly lit winter scene with gently blurred evergreen branches, subtle snow-like highlights, and cool festive lights in the background, creating a fresh, elegant, and distinctly Christmas mood while keeping the focus on the product.
Name: Red
Prompt: Displayed against a rich red holiday backdrop with softly glowing warm fairy lights and lightly blurred Christmas motifs such as pine sprigs and festive ribbons, creating a joyful yet elegant seasonal atmosphere without overwhelming the product.
Name: Goldtone
Prompt: On a warm neutral wooden or fabric-textured surface, displayed with a softly blurred golden field in the distant background and sunlit airy tones, creating a gentle, grounded, and soothing natural mood without distracting details.
Name: Goldsilk
Prompt: On soft beige satin fabric with natural folds, background also draped with matching light beige satin fabric, soft natural lighting, minimal and high-end scene, clean and realistic.
Name: Room
Prompt: Displayed in a warm, softly lit bedroom setting with cozy bedding textures and gentle ambient light, with a softly blurred window and minimal furniture in the distant background, creating a calm, intimate, and elegant atmosphere that keeps full focus on the product.
Name: Bokeh
Prompt: On a smooth glossy surface. Soft golden lights and blurred bokeh backdrop.
Name: Glass
Prompt: Displayed in front of a reeded glass divider with fine linear patterns, with only faint, heavily blurred green plant silhouettes barely visible behind the glass, creating a calm, elegant, and minimal premium background.
Name: Geometry
Prompt: Displayed in a calm studio with intersecting neutral architectural planes, balanced shadows, and a clean, minimal modern style.
Name: Modern
Prompt: Set in a clean exhibition-style space with modular partitions and balanced illumination, forming a formal, modern, and neutral visual stage.
Name: Water
Prompt: Set against a clean, soft-blue water surface with smooth flowing ripples and controlled reflective highlights, giving the scene a modern, minimal, and upscale aesthetic.
Name: Rose
Prompt: foDisplayed on a refined neutral surface, accented with a few carefully arranged dewdrop roses and eucalyptus leaves, under soft diffused studio lighting with a subtle blurred botanical backdrop, creating an elegant and luxurious atmosphere.o
Name: Ice
Prompt: On a smooth frosted-white matte surface, displayed with a softly blurred frozen lake in the background featuring gentle icy textures, pale blue tones, and soft diffused winter light, creating a clean, serene, and elegantly refreshing atmosphere that remains minimal and unobtrusive.
Name: Leafshade
Prompt: Displayed on a pedestal stand with a faint large-leaf shadows cast on a neutral wall, adding natural depth without showing any actual plants.
Name: Seashore
Prompt: On a smooth light-sand matte surface, displayed with a softly blurred coastal background featuring calm ocean colors and subtle natural elements such as a few out-of-focus seashells and delicate dune grasses, creating a fresh, elegant seaside atmosphere that remains minimal and unobtrusive.
Name: Greenscape
Prompt: On a warm neutral surface, displayed with softly blurred outdoor garden greenery featuring varied leaf shapes and soft ambient sunlight, forming a cozy, natural, and refreshingly organic background that stays minimal and unobtrusive.
Portrait
Name: Christmas
Prompt: Cozy Christmas window view, snowy pine forest outside, wooden frame with cream curtains, decorated tree, snowman plush, plaid pillows, evergreen garland, warm holiday home interior
Name: Fireworks
Prompt: New Year’s Eve night scene with large fireworks bursting high in the sky, natural explosion shapes with visible smoke trails, dark night sky, city skyline softly lit below, subtle reflections on water, realistic colors, photographic night exposure
Name: Coast
Prompt: Mediterranean coast, turquoise ocean with sunlight, rocky cliffs, sailboat, stone terrace, yellow wildflowers, sunny luxury vacation scene
Name: Aurora
Prompt: Iceland Northern Lights, vibrant green and blue aurora borealis dancing across night sky, snow-covered mountains, icy landscape, stars, magical arctic atmosphere, winter wonderland
Name: Cabins
Prompt: Alpine ski resort with rustic wooden cabins, snow-covered mountains, clear blue sky with white clouds, falling snowflakes, bright sunny winter day, vacation village atmosphere
Name: Sand
Prompt: Warm summer beach scene, cream beige towel, woven throw blanket with fringe, sandy texture, bright natural sunlight with shadows, vacation lifestyle flatlay, earthy tones
Name: Waterfall
Prompt: Wide waterfall in a natural landscape, flowing water in the background, soft mist in the air, distant rock formations and greenery, balanced natural lighting, low contrast, realistic textures, calm and clean atmosphere, unobtrusive background suitable for product display
Name: Glacier
Prompt: Jökulsárlón glacier lagoon Iceland, floating blue icebergs in crystal clear water, snow-capped mountains in background, clear blue sky, dramatic Arctic landscape, serene frozen beauty
Name: Paris
Prompt: Parisian street view with Eiffel Tower in background, classic French cafe with red awning, colorful flowers, cream Haussmann buildings, blue sky with white clouds, spring atmosphere
Name: Santorini
Prompt: Santorini cliffside at golden hour, whitewashed buildings overlooking the sea, blue domes, soft evening light, romantic Mediterranean sunset glow
Name: Kyoto
Prompt: Kyoto in spring, full bloom cherry blossom sakura tree, five-story pagoda, traditional Japanese temple rooftops, white wall, overcast sky, peaceful hanami season atmosphere
Name: Lake
Prompt: Nordic fjord at golden hour, calm reflective water, dramatic cliffs on both sides, lush green vegetation in the foreground, soft evening light, peaceful Scandinavian nature, warm sunset glow
Name: Garden
Prompt: Luxembourg Gardens Paris, Medici Fountain with baroque sculptures, ornamental pond, pink flowering plants, dappled sunlight through plane trees, classic French garden, peaceful atmosphere
Name: Tokyo
Prompt: A high-energy Y2K-inspired editorial collage poster with a strong paper-cut and magazine print aesthetic. The entire image has a tactile paper texture with visible cut edges and layered depth. The theme centers around the city Tokyo. All visual elements, including background imagery, stickers, symbols, typography, and graphic decorations, are culturally and visually inspired by Tokyo. The composition follows a fashion magazine cover logic with dense but controlled information, playful energy, and strong visual hierarchy. The character is designed as a dominant half-body portrait occupying most of the poster. Center-focused editorial collage layout. At the top, the city name “Tokyo” appears as the main headline in bold uppercase geometric sans-serif letters. Each letter is placed on an individual colored paper rectangle and arranged in a slight arc. The large half-body character overlaps and partially covers the headline and nearby graphic elements, creating a break-the-frame effect. Surrounding the character are floating paper stickers, speech bubbles, and cut-out graphics featuring instantly recognizable Japanese icons without text, such as Tokyo Tower silhouettes, Mount Fuji outlines, Shibuya crosswalk stripes, vending machines, capsule toy machines, ramen bowls with chopsticks, onigiri rice balls, maneki-neko lucky cats, folding fans, cameras, and everyday Tokyo street objects rendered as simple graphic cut-outs. The background features a stylized Tokyo night cityscape filled with neon lights and glowing signage, rendered in a desaturated or limited-color palette with visible grain, halftone dots, and printed-paper texture, evoking a vintage magazine or poster rather than realistic photography. The bottom section features a full-width magazine-style collage footer composed of layered paper strips, bold button-style typography, small editorial text blocks, and thumbnail-style graphics.
Name: Shanghai
Prompt: The Bund in Shanghai at dusk, historic waterfront buildings along the Huangpu River, modern skyline across the river, soft evening light, city lights beginning to glow, realistic urban scene, calm and atmospheric
Name: Coffee
Prompt: Cozy European café interior, exposed brick walls, wooden tables and chairs, warm Edison bulb string lights, vintage coffee bar with espresso machine, soft natural window light, bohemian atmosphere
Name: Home
Prompt: Cozy bedroom scene, unmade bed with cream white sheets and blue denim clothing, soft natural morning light, casual lifestyle photography, warm beige tones, relaxed atmosphere
Name: Office
Prompt: Modern office interior, blurred desk with computer monitor, wooden workspace, green potted plants, warm pendant lights, natural window light, soft bokeh background, professional atmosphere
Sign up for an API key
To access the API, you’ll need an API Key.
Create a Nero AI account to generate your API Key and start integrating AI-powered image processing into your workflow.