# Authentication Source: https://novita.ai/docs/api-reference/basic-authentication The `Novita AI` API uses API keys in the `request headers` to authenticate requests. You can view and manage your API keys in [settings page](https://novita.ai/settings#key-management?utm_source=getstarted). ```js { "Authorization": "Bearer {{API Key}}" } ``` # API Error Codes Source: https://novita.ai/docs/api-reference/basic-error-code ## Image / Video / Audio
Error Name | Status Code | Description |
---|---|---|
INVALID\_REQUEST\_BODY | 400 | Request parameter validation failed |
IMAGE\_FILE\_EXCEEDS\_MAX\_SIZE | 400 | Image size exceeds limit |
INVALID\_IMAGE\_FORMAT | 400 | Image format does not meet requirements |
IMAGE\_EXCEEDS\_MAX\_RESOLUTION | 400 | Image resolution exceeds limit |
INVALID\_IMAGE\_SIZE | 400 | Image width or height exceeds limit |
API\_NOT\_FOUND | 404 | API not found |
IMAGE\_NO\_FACE\_DETECTED | 400 | No face detected |
INVALID\_CUSTOM\_OUTPUT\_PATH | 400 | Invalid OSS path |
ILLEGAL\_PROMPT | 400 | Prompt contains inappropriate content |
ILLEGAL\_IMAGE\_CONTENT | 400 | Image contains inappropriate content |
INVALID\_AUDIO\_FILE | 400 | Invalid audio input |
BILLING\_FAILED | 500 | Billing service error |
BILLING\_AUTH\_FAILED | 403 | Billing service authentication failed |
BILLING\_BALANCE\_NOT\_ENOUGH | 400 | Insufficient balance |
MISSING\_API\_KEY | 400 | API Key not provided |
INVALID\_API\_KEY | 403 | API Key validation failed |
FEATURE\_NOT\_ALLOWED | 403 | No permission to upload model |
API\_NOT\_ALLOWED | 403 | No permission to use this API |
RATE\_LIMIT\_EXCEEDED | 429 | Rate limit exceeded |
NEED\_REAL\_NAME\_VERIFY | 403 | Enterprise verification not completed |
CREATE\_TASK\_FAILED | 500 | Failed to create task |
TASK\_NOT\_FOUND | 404 | Task not found |
GET\_RESULT\_FAILED | 500 | Failed to get task result |
TASK\_FAILED | 500 | Task execution failed |
Error Name | Status Code | Description |
---|---|---|
INVALID\_API\_KEY | 403 | API Key not provided |
MODEL\_NOT\_FOUND | 404 | Model not found |
FAILED\_TO\_AUTH | 401 | Authentication failed |
NOT\_ENOUGH\_BALANCE | 403 | Insufficient balance |
INVALID\_REQUEST\_BODY | 400 | Request body format error, see message for details |
RATE\_LIMIT\_EXCEEDED | 429 | Too many requests, please try again later |
TOKEN\_LIMIT\_EXCEEDED | 429 | Token limit exceeded, please try again later |
SERVICE\_NOT\_AVAILABLE | 503 | Service unavailable |
ACCESS\_DENY | 403 | Access denied |
Error Name | Status Code | Description |
---|---|---|
UNKNOWN | 500 | Unknown error |
GET\_TOKEN\_FAILED | 400 | Failed to obtain token |
FORBIDDEN | 403 | Access forbidden / No permission |
UNAUTHORIZED | 401 | Unauthorized |
USER\_ALREADY\_EXISTS | 400 | User already exists |
INVALID\_USER\_OR\_PASSWORD | 400 | Invalid username or password |
INVALID\_CODE | 400 | Invalid verification code |
USER\_NOT\_FOUND | 400 | User not found |
USER\_PHONE\_NOT\_CONSIST | 400 | User phone number mismatch |
SEND\_CODE\_TOO\_FAST | 429 | Verification code sent too frequently |
INVALID\_PUBLIC\_KEY | 400 | Invalid public key |
USER\_NOT\_ACTIVATED | 400 | User not activated |
USER\_ALREADY\_ACTIVATED | 400 | User already activated |
INVALID\_USER\_TOKEN | 400 | Invalid user token |
BANNED\_USER | 400 | Account has been banned |
RATE\_LIMIT\_EXCEEDED | 429 | Request rate limit exceeded |
RESOURCE\_NOT\_FOUND | 400 | Resource not found (e.g., container not found) |
CONFLICT | 400 | Conflict (e.g., container conflict) |
VALIDATOR\_PARAM | 400 | Parameter validation failed / Invalid parameter |
REQUEST | 400 | Request error |
OPERATION\_LIMIT | 400 | Operation limit reached |
INSUFFICIENT\_RESOURCE | 400 | Insufficient resources |
CLUSTER\_STATUS | 400 | Cluster status abnormal |
NODE\_STATUS | 400 | Node status abnormal |
DEPENDENT\_RESOURCE\_STATE | 400 | Dependent resource state abnormal |
PREPAID\_INSTANCE\_NOT\_SUPPORT\_RELEASE | 400 | Prepaid instance does not support release |
CREATING\_INSTANCE\_NOT\_SUPPORT\_RENEWAL | 400 | Instance in creation does not support renewal |
INSTANCE\_LOCAL\_STORAGE\_NOT\_FOUND | 400 | Instance local storage not found |
INVALID\_COMMAND\_PARAM | 400 | Invalid instance startup command parameter |
GPU\_SPEC\_USED | 400 | GPU specification already in use |
INCORRECT\_USER\_SYNCER\_REQUIRE\_PARAMS | 400 | Incorrect user syncer request parameters |
MIGRATE\_INSUFFICIENT\_RESOURCE | 400 | Insufficient resources for migration |
WALLET\_NOT\_FOUND | 500 | Wallet not found |
WALLET\_UNSUPPORT\_RECHARGE\_METHOD | 400 | Unsupported wallet recharge method |
BALANCE\_NOT\_ENOUGH | 400 | Insufficient balance |
UNSUPPORTED\_BILLING\_MODE | 400 | Unsupported billing mode |
EXPIRED\_OR\_BALANCE\_NOT\_ENOUGH | 400 | Expired or insufficient balance |
ORDER\_NOT\_FOUND | 400 | Order not found |
SAVING\_PLAN\_ALREADY\_EXISTS | 400 | Saving plan already exists |
CREATE\_INSTANCE\_LIMIT | 400 | Instance creation limit reached, please recharge or delete other instances |
NETWORK\_STORAGE\_TOO\_LARGE | 400 | Network storage size exceeds limit |
CUR\_CLUSTER\_NETWORK\_STORAGE\_NOT\_SUPPORT | 400 | Network storage not supported in current region |
NETWORK\_STORAGE\_IN\_USE | 400 | Network storage is in use |
NETWORK\_STORAGE\_UNAVAILABLE | 400 | Network storage unavailable |
NETWORK\_STORAGE\_NOT\_FOUND | 400 | Network storage not found |
IMAGE\_NOT\_FOUND | 400 | Image not found |
IMAGE\_AUTH\_IN\_USE | 400 | Image authentication in use |
NETWORK\_NOT\_FOUND | 400 | Instance network not found |
NETWORK\_IN\_USE | 400 | Instance network in use |
NETWORK\_MAX\_LIMIT | 400 | Instance network creation limit exceeded |
SEND\_MSG\_ERROR | 400 | Message sending error |
JOB\_NOT\_FOUND | 400 | Instance job not found |
SERVERLESS\_ENDPOINT\_NOT\_FOUND | 400 | Serverless endpoint not found |
SERVERLESS\_WORKER\_NOT\_FOUND | 400 | Serverless worker not found |
SERVERLESS\_PRODUCT\_NOT\_FOUND | 400 | Serverless product not found |
SERVERLESS\_APP\_NAME\_IS\_EXIST | 400 | Serverless application name already exists |
TEMPLATE\_IS\_PRIVATE | 400 | Template is private |
TEMPLATE\_NOT\_FOUND | 400 | Template not found |
Error Name | Status Code | Description |
---|---|---|
UNKNOWN | 500 | Unknown error, please contact us |
LIST\_BILL\_TOO\_FAST | 429 | Requests are too frequent, please try again later |
INVALID\_PRODUCT\_CATEGORY | 400 | Invalid productCategory parameter |
INVALID\_BILL\_CYCLE | 400 | Invalid cycle parameter |
LIST\_BILL\_ERROR | 500 | Query error, please contact us |
text
) and preview model (model
) are provided in the request body, this parameter returns the preview audio as a URL.
voice\_id
.
Model | T1 | T2 | T3 | T4 | T5 |
---|
Tier | How to reach |
---|---|
T1 | Monthly top-ups did not exceed \$50 in any of the last 3 calendar months. |
T2 | Monthly top-ups were at least \$50 but did not exceed \$500 in any of the last 3 calendar months. |
T3 | Monthly top-ups were at least \$500 but did not exceed \$3,000 in any of the last 3 calendar months. |
T4 | Monthly top-ups were at least \$3,000 but did not exceed \$10,000 in any of the last 3 calendar months. |
T5 | Monthly top-ups were at least \$10,000 in at least one of the last 3 calendar months. |
V2 | V3 | Description |
---|---|---|
**extra**object | **extra**object | |
enable\_nsfw\_detection boolean |
enable\_nsfw\_detection boolean |
|
nsfw\_detection\_level Enum: `0, 1, 2` |
nsfw\_detection\_level Enum: `0, 1, 2` |
|
enable\_progress\_info | Deprecated | |
response\_image\_type Enum: `png`, `jpeg` |
response\_image\_type Enum: `png, webp, jpeg` |
V3 adds support for `webp`image format |
**request**object | New Field All image generation parameters must be passed via the `request`in V3 |
|
**prompt**string \ |
promptstring | Moved Inside |
lorasobject\[] | Moved Inside **Migrate LoRA usage: From **`prompt`** to **`request.loras`** parameter** |
|
model\_namestring | New Field Name of lora, retrieve the corresponding sd\_name\_in\_api value by invoking the [Get Model API](https://novita.ai/docs/api-reference/model-apis-get-model) endpoint with filter.types=lora as the query parameter. |
|
strengthnumber(float32) | New Field The strength value of lora. The larger the value, the more biased the effect is towards lora, Range \[0, 1] |
|
**negative\_prompt**string | negative\_promptstring | Moved Inside |
**sampler\_name**string | sampler\_namestring | Moved Inside |
**batch\_size**integer | image\_numinteger | Changed `num_images` **→** `request.image_num` |
**n\_iter** | Deprecated | |
**steps**string | stepsstring | Moved Inside |
**cfg\_scale**integer | guidance\_scale number(float32) |
Changed `cfg_scale`**→** `request.guidance_scale` |
**seed**integer | seedinteger | Moved Inside |
**height**integer | heightinteger | Moved Inside Range Change: \[128, 2048]. |
**width**integer | widthinteger | Moved Inside Range Change: \[128, 2048]. |
**model\_name**string | model\_namestring | Moved Inside This parameter specifies the name of the model checkpoint. Retrieve the corresponding sd\_name value by invoking the [Query Model](https://novita.ai/docs/api-reference/model-apis-get-model) API with filter.types=checkpoint as the query parameter. |
**restore\_faces**bool | restore\_facesbool | Moved Inside |
**restore\_faces\_model** | Deprecated | |
**sd\_vae**string | sd\_vaestring | Moved Inside |
**clip\_skip**integer | clip\_skipinteger | Moved Inside |
**enable\_hr**boolean | hires\_fixobject | Changed `enable_hr`**→** `request.hires_fix` |
**hr\_upscaler** Enum: `Latent`, `ESRGAN_4x`, `R-ESRGAN 4x+`, `R-ESRGAN 4x+ Anime6B` |
upscaler Enum: `RealESRGAN_x4plus_anime_6B`, `RealESRNet_x4plus,Latent` |
Changed `hr_upscaler`**→**`request.hires_fix.upscaler` |
**hr\_scale**number | Deprecated | |
**hr\_resize\_x**integer | target\_widthinteger | Changed `hr_resize_x`**→** `request.hires_fix.target_width` |
**hr\_resize\_y**integer | target\_heightinteger | Changed `hr_resize_y`**→** `request.hires_fix.target_height` |
**img\_expire\_ttl**integer | Deprecated Default 3600s |
|
**sd\_refiner**object | refinerobject | Changed `sd_refiner`**→** `request.refiner` |
checkpointstring | Deprecated | |
switch\_at number(float32) |
switch\_at number(float32) |
Changed `sd_refiner.switch_at`**→** `request.refiner.switch_at` |
**controlnet\_units**object\[] | Deprecated `img2img` Only |
V2 | V3 | Description |
---|---|---|
**code** | Deprecated | |
**msg** | Deprecated | |
**data** | Deprecated | |
task\_id | **task\_id** | Changed `data.task_id`**→** `task_id` |
warn | Deprecated |
V2 | V3 | Description |
---|---|---|
**extra**object | **extra**object | |
enable\_nsfw\_detection boolean |
enable\_nsfw\_detection boolean |
|
nsfw\_detection\_level Enum: `0, 1, 2` |
nsfw\_detection\_level Enum: `0, 1, 2` |
|
enable\_progress\_info | Deprecated | |
response\_image\_type Enum: `png`, `jpeg` |
response\_image\_type Enum: `png, webp, jpeg` |
V3 adds support for `webp`image format |
**request**object | New field All image generation parameters must be passed via the `request`in V3 |
|
**prompt**string \ |
promptstring | Moved Inside |
lorasobject\[] | Moved Inside **Migrate LoRA usage: From **`prompt`** to **`request.loras`** parameter** |
|
model\_namestring | New Field Name of lora, retrieve the corresponding sd\_name\_in\_api value by invoking the [Get Model API](https://novita.ai/docs/api-reference/model-apis-get-model) endpoint with filter.types=lora as the query parameter. |
|
strength number(float32) |
New Field The strength value of lora. The larger the value, the more biased the effect is towards lora, Range \[0, 1] |
|
**negative\_prompt**string | negative\_prompt string |
Moved Inside |
**sampler\_name**string | sampler\_namestring | Moved Inside |
**batch\_size**integer | image\_numinteger | Changed `batch_size`**→** `request.image_num` |
**n\_iter**integer | Deprecated | |
**steps**string | stepsstring | Moved Inside |
**cfg\_scale**integer | guidance\_scale number(float32) |
Changed `cfg_scale`**→** `request.guidance_scale` |
**seed**integer | seedinteger | Moved Inside |
**height**integer | heightinteger | Moved Inside Range Change: \[128, 2048]. |
**width**integer | widthinteger | Moved Inside Range Change: \[128, 2048]. |
**model\_name**string | model\_namestring | Moved Inside This parameter specifies the name of the model checkpoint. Retrieve the corresponding sd\_name value by invoking the [Query Model](https://novita.ai/docs/api-reference/model-apis-get-model) API with filter.types=checkpoint as the query parameter. |
**init\_images**string\[] | image\_base64string | Changed `init_images`**→** `request.image_base64` |
**denoising\_strength** number(float) |
strength number(float) |
Changed `denoising_strength`**→** `request.strength` |
**restore\_faces**bool | Deprecated | |
**sd\_vae**string | sd\_vaestring | Moved Inside |
**clip\_skip**integer | clip\_skipinteger | Moved Inside |
**mask**string | Deprecated Recommendation: Use V3 Inpainting API |
|
**mask\_blur**integer | Deprecated Recommendation: Use V3 Inpainting API |
|
**resize\_mode**integer | Deprecated | |
**image\_cfg\_scale**integer | Deprecated | |
**inpainting\_fill**integer | Deprecated Recommendation: Use V3 Inpainting API |
|
**inpaint\_full\_res**integer | Deprecated Recommendation: Use V3 Inpainting API |
|
**inpaint\_full\_res\_padding** integer |
Deprecated Recommendation: Use V3 Inpainting API |
|
**inpainting\_mask\_invert** integer |
Deprecated Recommendation: Use V3 Inpainting API |
|
**initial\_noise\_multiplier** number(float32) |
Deprecated | |
**img\_expire\_ttl**integer | Deprecated Default 3600s |
|
**sd\_refiner**object | refinerobject | Changed `sd_refiner`**→** `request.refiner` |
checkpoint | Deprecated | |
switch\_at number(float32) |
switch\_at number(float32) |
Moved Inside |
controlnetobject | New Field | |
**controlnet\_units**object\[] | unitsobject\[] | Changed `controlnet_units`**→** `request.controlnet.units` |
modelstring | model\_name string |
Changed `controlnet_units.model`**→** `request.controlnet.units.model_name` |
weightnumber | strength number(float32) |
Changed `controlnet_units.weight`**→** `request.controlnet.units.strength` |
input\_imagestring | image\_base64 string |
Changed `controlnet_units.input_image`**→** `request.controlnet.units.image_base64` |
modulestring,Enum | preprocessor string,Enum |
Changed `controlnet_units.module`**→** `request.controlnet.units.preprocessor` |
control\_mode | Deprecated | |
mask | Deprecated Recommendation: Use V3 Inpainting API |
|
resize\_mode | Deprecated | |
processor\_res | Deprecated | |
threshold\_a | Deprecated | |
threshold\_b | Deprecated | |
guidance\_start number(float32) |
guidance\_start number(float32) |
Moved Inside |
guidance\_end number(float32) |
guidance\_end number(float32) |
Moved Inside |
pixel\_perfect | Deprecated |
V2 | V3 | Description |
---|---|---|
code | Deprecated | |
msg | Deprecated | |
data | Deprecated | |
task\_id | **task\_id** | Changed `data.task_id`**→** `task_id` |
warn | Deprecated |
Billing Item | Description |
---|---|
CPU | Billed based on the number of vCPU cores used and usage duration (accurate to the second). Current pricing can be found on the [here](https://novita.ai/pricing?sandbox=1). No billing occurs after the Sandbox is stopped. |
RAM (memory) | Billed based on allocated memory capacity and usage duration (accurate to the second). Current pricing can be found on the [here](https://novita.ai/pricing?sandbox=1). No billing occurs after the Sandbox is stopped. |
Storage | Currently free. Each Sandbox is allocated a fixed 20 GB storage space. |
Templates | Currently free. |
vCPUs (cores) | Unit Price |
---|---|
1 | \$0.0000098/s |
2 | \$0.0000196/s |
3 | \$0.0000294/s |
4 | \$0.0000392/s |
5 | \$0.000049/s |
6 | \$0.0000588/s |
7 | \$0.0000686/s |
8 | \$0.0000784/s |
Memory (MiB) | Unit Price |
---|---|
Even value between 128 MiB \~ 8192 MiB | \$0.0000016/GiB/s |
512 MiB | \$0.0000008/s |
1 GiB | \$0.0000016/s |
2 GiB | \$0.0000032/s |