Authorization
The Nero AI API requires authorization via an API key generated within your Nero AI account.
All of the methods in the Nero AI API require authorization using x-neroai-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".
API
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 example
curl -X POST 'https://api.nero.com/biz/api/task' \
--header 'x-neroai-api-key: your API key' \
--header 'Content-Type: application/json' \
--data '{
"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
Take "ImageUpscaler:Standard" as an example below.
Supported Formats
Currently, the supported file formats are JPG
, JPEG
, PNG
, BMP
, WEBP
, JFIF
, JFI
, JPE
, JIF
and ICO
.
Request example
curl -X POST 'https://api.nero.com/biz/api/task' \
--header 'x-neroai-api-key: your API key' \
--header 'Content-Type: application/json' \
--data '{
"type": "ImageUpscaler:Standard",
"body": {
"image": "https://image.url"
}
}'
Response success example
{
"code": 0,
"data": {
"task_id": "bmtrfykh"
}
}
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 |
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 or 4, default is 4 (face enhancement is not supported) |
Query task result
curl 'https://api.nero.com/biz/api/task?task_id=bmtrfykh' \
--header 'x-neroai-api-key: your API key'
Response success example
// 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"
}
}
ScratchFix
Supported Formats
Currently, the supported file formats are JPG
, JPEG
, PNG
, BMP
, WEBP
, JFIF
, JFI
, JPE
and JIF
.
Request example
curl -X POST 'https://api.nero.com/biz/api/task' \
--header 'x-neroai-api-key: your API key' \
--header 'Content-Type: application/json' \
--data '{
"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"
}
}
}
ColorizePhoto
Supported Formats
Currently, the supported file formats are JPG
, JPEG
, PNG
, BMP
, WEBP
, JFIF
, JFI
, JPE
and JIF
.
Request example
curl -X POST 'https://api.nero.com/biz/api/task' \
--header 'x-neroai-api-key: your API key' \
--header 'Content-Type: application/json' \
--data '{
"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"
}
}
}
FaceRestoration
Supported Formats
Currently, the supported file formats are JPG
, JPEG
, PNG
, BMP
, WEBP
, JFIF
, JFI
, JPE
and JIF
.
Request example
curl -X POST 'https://api.nero.com/biz/api/task' \
--header 'x-neroai-api-key: your API key' \
--header 'Content-Type: application/json' \
--data '{
"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"
}
}
}
FaceAnimation:Detection
Supported Formats
Currently, the supported file formats are JPG
, JPEG
, PNG
, BMP
and WEBP
.
Request example
curl -X POST 'https://api.nero.com/biz/api/task' \
--header 'x-neroai-api-key: your API key' \
--header 'Content-Type: application/json' \
--data '{
"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
curl -X POST 'https://api.nero.com/biz/api/task' \
--header 'x-neroai-api-key: your API key' \
--header 'Content-Type: application/json' \
--data '{
"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 |
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"
}
}
}
AvatarProfileTraining
Request example
curl -X POST 'https://api.nero.com/biz/api/task' \
--header 'x-neroai-api-key: your API key' \
--header 'Content-Type: application/json' \
--data '{
"type": "AvatarProfileTraining",
"body": {
"images": [
"https://image1.url",
"https://image2.url"
],
"presets": [
{ "id": "zuxdrewf", "count": 1 },
{ "id": "fstzzsma", "count": 1 }
]
}
}'
Headers
Field | Description |
---|---|
x-neroai-api-key | your API key |
Parameters
Field | Type | Required | Description |
---|---|---|---|
type | string | true | AvatarProfileTraining |
body.images | Array |
true | image urls, at least 10 images |
body.presets | Array<{ id, count }> | true | you can get presets from avatar API |
body.presigned_urls | Array |
false | a list of presigned URLs generated for temporary upload access to private objects. |
Task result
{
"code": 0,
"data": {
"status": "done",
"result": {
"outputs": [
{ "preset_id": "zuxdrewf", "image": "https://image.url" },
{ "preset_id": "fstzzsma", "image": "https://image.url" }
]
}
}
}
BackgroundRemover
Supported Formats
Currently, the supported file formats are JPG
, JPEG
, PNG
, BMP
, WEBP
, JFIF
, JFI
, JPE
and JIF
.
Request example
curl -X POST 'https://api.nero.com/biz/api/task' \
--header 'x-neroai-api-key: your API key' \
--header 'Content-Type: application/json' \
--data '{
"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
and JIF
.
Request example
curl -X POST 'https://api.nero.com/biz/api/task' \
--header 'x-neroai-api-key: your API key' \
--header 'Content-Type: application/json' \
--data '{
"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"
}
}
}
ImageDenoiser
Supported Formats
Currently, the supported file formats are JPG
, JPEG
, PNG
, BMP
, WEBP
, JFIF
, JFI
, JPE
and JIF
.
Request example
curl -X POST 'https://api.nero.com/biz/api/task' \
--header 'x-neroai-api-key: your API key' \
--header 'Content-Type: application/json' \
--data '{
"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"
}
}
}
ImageCompressor
Supported Formats
Currently, the supported file formats are JPG
, JPEG
, PNG
, BMP
, WEBP
and GIF
.
Request example
curl -X POST 'https://api.nero.com/biz/api/task' \
--header 'x-neroai-api-key: your API key' \
--header 'Content-Type: application/json' \
--data '{
"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"
}
}
}
ImageToImage
Supported Formats
Currently, the supported file formats are JPG
, JPEG
, PNG
, BMP
and WEBP
.
Request example
curl -X POST 'https://api.nero.com/biz/api/task' \
--header 'x-neroai-api-key: your API key' \
--header 'Content-Type: application/json' \
--data '{
"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 |
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"
]
}
}
}
ObjectCounter
Request example
curl -X POST 'https://api.nero.com/biz/api/task' \
--header 'x-neroai-api-key: your API key' \
--header 'Content-Type: application/json' \
--data '{
"type": "ObjectCounter",
"body": {
"image": "https://image.url",
"guide_boxes": [[[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 | ImageToImage |
body.image | string | true | an image url |
body.guide_bboxes | Array |
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
}
}
}
Avatar
Groups
Query avatar groups
GET
https://api.nero.com/biz/api/avatar/groups
Response success example
{
"code": 0,
"data": {
"groups": [
{
"group_id": "general_12",
"title": "Portraits",
"description": "Create different looks for your portrait photos.",
"image": "https://image.url",
"good_sample_images": [
"https://good_sample_image1.url",
"https://good_sample_image2.url"
],
"bad_sample_images": [
"https://bad_sample_image1.url",
"https://bad_sample_image2.url"
]
}
]
}
}
Presets
Query avatar presets
GET
https://api.nero.com/biz/api/avatar/presets?group_id=
Response success example
{
"code": 0,
"data": {
"presets": [
{
"id": "8k3823bd",
"name": "luxury fashion",
"type": "Female"
},
{
"id": "fs3j8e06",
"name": "luxury fashion",
"type": "Female"
}
]
}
}
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"
}
]
}
}
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
Request example
curl -X PUT 'https://api.nero.com/biz/api/apikey/replace' \
--header 'Content-Type: application/json' \
--data '{
"key": "your API key"
}'
Parameters
Field | Type | Required | Description |
---|---|---|---|
key | string | true | your API key |
Response success example
{
"code": 0,
"data": {
"key: "new API key"
}
}
Error
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"
}