🇺🇸English Version

Introduction

Welcome to join A1's developer platform and explore the infinite possibilities of AIGC together!

A1.art is committed to providing a variety of image generation apps to help developers easily integrate and use image generation technology to meet different business needs.

A1 platform has launched over 2200 + apps, including various avatar styles such as comics, dopamine, 3D Disney, various AI portrait applications such as "Barbie", "Sailor Moon", and Christmas themes, as well as a variety of emoji packs, artistic fonts, etc., all waiting for you to explore!

By calling our API, you can quickly integrate the photo app into your application or service, enhancing User Experience and product value.

Our platform features include:

  • Diversified image generation applications : Provide a variety of image generation applications to meet the needs of different scenarios.

  • Easy integration : Integrate powerful image generation capabilities into your project with a simple API call.

  • Efficient performance : Optimized algorithms and server architecture ensure fast response and high-quality image output.

  • Flexible customization : supports multiple parameter settings to meet personalized image generation needs.

Whether you want to provide personalized image generation services for your users or need to automatically generate images in internal systems, our platform can provide powerful support for you.

API Charging Rules

The API interface will generate watermark-free images for you to apply to your personal business. For every watermark-free image generated, 1 point will be deducted from your account.

You can earn points by subscribing to the Basic, Pro, or Mega versions, or contact us directly to discuss setting up a custom plan.

Please pay attention to keeping the account balance sufficient to avoid call failure affecting the normal use of your business

For more subscription-related content, please refer to

What capabilities does the API provide?

API currently provides 4 interfaces:

  • Get APP information

  • Upload image (for image to image generation)

  • Generate images

  • Get generated results

Basic introduction

Access authorization

Prefix

https://a1.art

Note: If you encounter problems with registration in China, you can try using the domain name https://a1art.xiaopiu.com

Request specification

  • Network protocol: HTTPSprotocol.

  • Encoding format: UTF-8encoding.

  • Request header: You must carry apiKey for background authentication and authentication. (Get API key)

  • Response result: JSON data format. The response body structure of the API includes four parts: code, msg, msg_cn, and data. Code is the error code, msg is the English error description, msg_cn is the Chinese error description, and data is the result returned after calling the API; if the code is not 0 , the request is considered to have failed, and the failure information can refer to msg and msg_cn .

Response body

Parameter name

Type

Description

code

int

Error code

msg

string

English Error Message

msg_cn

string

Chinese Error Message

data

json

Response data

Data structure

Application

export type APPInfo = {
  id: string;
  versionId: string;
  name: string;
  formArr: []Form; 
  styleArr: []Style;
  updateDate: Date;
  createDate: Date;
};

Form

// Type of the type field in the formCorresponding style, pictures, text, size
export type FormItemTypeFieldType = 'style' | 'cnet' | 'description' | 'size' ;

export type Form = {
  id: string; // The id that needs to be passed for the image generation interface (except for descriptions with inputs).
  type: FormItemTypeFieldType;
  title: string;
  inputs: []Input; 
};

Input

export type Input = {
  id: string; // The id that needs to be passed in the description form of the image generation interface
  title: string;
  tags: []string; // description form prompt
};

Style

export type Style = {
  id: string;
  name: string;
  image: string;
};

Size

// Types of sizeId field in form: 1-5 pairs corresponding to size 1:1, 3:4, 1:2, 4:3, 2:1
export type FormSizeIdType = '1' | '2' | '3''4' | '5' ;

Task

// Task execution status, 0 - task has been submitted, 10 - task has been completed, 20 - task failed, 30 - task in progress.
export type TaskStateType = 010 | 20 | 30 ;

export type Task = {
  id: string;
  startDate: Date;
  finishDate: Date;
  createDate: Date;
  images: []string;
  state: number;
};

API key

To issue an authorization request as a user, you must use an API key.

You can find and manage your API key from the personal avatar in the upper right corner of the website

Application

Get Application Details

/open-api/v1/a1/apps/{appId}

Request Parameters

Field Name

Type

Location

Is Mandatory

Meaning

apiKey

string

header

Yes

API key

appId

string

path

Yes

Application ID

Parameter limit

  • Unpublished applications cannot be queried

  • Applications with digital avatars, wordart, and group photo components cannot be queried.

Request example

curl --location --request GET 'https://a1.art/open-api/v1/a1/apps/{appId}' \
--header 'apiKey: {apiKey}' \
--header 'Accept: */*' \
--header 'Host: a1.art' \
--header 'Connection: keep-alive'

Response example

{
    "code": 0,
    "msg": "success",
    "msg_cn": "成功",
    "data": {
        "appInfo": {
            "id": "1803632078862147586",
            "versionId": "1803632078866341890",
            "name": "Crazy Pet",
            "formArr": [ // Form parameters required for the image generation interface
                {
                    "id": "1705408562085",
                    "type": "cnet",
                    "title": "Photo of your pet"
                },
                {
                    "id": "1705403286130",
                    "type": "description",
                    "title": "Description",
                    "inputs": [
                        {
                            "id": "description_1705463790428_variant1",
                            "title": "Color and breed, such as: black devon rex cat",
                            "tags": [
                                "Obsidian_black",
                                "Porcelain_white"
                            ]
                        }
                    ]
                },
                {
                    "id": "1705398050190",
                    "type": "style",
                    "title": "Style"
                },
                {
                    "id": "1705403291444",
                    "type": "size",
                    "title": "Size"
                }
            ],
            "styleArr": [
                {
                    "id": "1766068889598496769",
                    "name": "High Quality Anmie",
                    "image": "https://cdn.a1.art/assets/style/cover_image/6d7358e9-ddae-4253-bcc9-d4f54ebc25d5.png"
                }
            ],
            "updateDate": "2024-06-20 19:51:55.0",
            "createDate": "2024-06-20 11:32:52.0"
        }
    }
}

Image

Upload images

/open-api/v1/a1/images/uploadNote: Only images uploaded through our system can be used as raw image parameters.

Request Parameters

Field Name

Type

Location

Is Mandatory

Meaning

apiKey

string

header

yes

API key

file

file

form-data

yes

Image file

Parameter limit

  • Only png, jpg and jpeg image files can be uploaded.

  • Only images can be uploaded through form forms.

  • Only one image can be uploaded at a time

  • Image file size cannot be greater than 10 MB

Request example

curl --location --request POST 'https://a1.art/open-api/v1/a1/images/upload' \
--header 'apiKey: {apiKey}' \
--header 'Accept: */*' \
--header 'Host: a1.art' \
--header 'Connection: keep-alive' \
--header 'Content-Type: multipart/form-data;' \
--form 'file=@"/Users/xxx/Downloads/imageName.png"'

Response example

{
    "code": 0,
    "msg": "success",
    "msg_cn": "成功",
    "data": {
        "imageUrl": "63fa41e7-e282-4582-a07b-8e5e73e8d388.jpg",
        "path": "assets/application/apikey_5f6ccf7b983e499fb8ba4e5c4de8013f/form/"
    }
}

Generate images

/open-api/v1/a1/images/generate

Request Parameters

Field Name

Type

Location

Is Mandatory

Meaning

apiKey

string

header

Yes

API key

appId

string

body

Yes

Application id

versionId

string

body

Yes

Application version id

generateNum

string

body

Yes

Number of images to be generated in this request

cnet

[]cnetForm

body

No

| Pictures relied on for Image-to-image |

string

body

Yes

id of the form of type cnet in formArr

cnetForm.imageUrl

string

body

Yes

See the return value of the upload image interface

cnetForm.path

string

body

Yes

See the return value of the upload image interface

description

[]descriptionForm

body

No

Descriptors relying on real-life photos

string

body

Yes

id of the form of type description in formArr (if there is an input field, it is the id of the input)

descriptionForm.value

string

body

Yes

Description words

styleId

string

body

No

The image style of the raw image depends on the source - the id in styleArr.

size

sizeForm

body

No

Original image size dependencies

sizeForm.sizeId

string

body

Yes

1 to 5 pairs corresponding to size 1:1 3:4 1:2 4:3 2:1

Parameter limit

  • You need to bring the latest versionId of the application.

  • Images stored in this system must be used

  • The number of images to be generated needs to be transferred (generateNum, 1~ 4). Note: Generate a few images and deduct a few points.

  • For the parameters in application formArr, pass at least one parameter for each type

  • When passing a parameter of type description in the form, if the form has an inputs field, the id of the description should be passed as the id of the input

Request example

curl --location --request POST 'https://a1.art/open-api/v1/a1/images/generate' \
--header 'apiKey: {apiKey}' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Host: a1.art' \
--header 'Connection: keep-alive' \
--data-raw '{
    "cnet": [
        {
            "id": {cnetId},
            "imageUrl": {imageUrl},
            "path": {path}
        }
    ],
    "description": [
        {
            "id": {descriptionId/inputId},  # If there are no "inputs" fields in the form, pass the description's id instead of the input's id.
            "value": {value}
        }
    ],
    "styleId": {styleId},
    "size": {
        "sizeId": {sizeId}
    },
    "appId": {appId},
    "versionId": {versionId},
    "generateNum": {generateNum}
}'

Response example

{
    "code": 0,
    "msg": "success",
    "msg_cn": "成功",
    "data": {
        "taskId": "507b080cfe17f7956e8690c4eba2b80f"
    }
}

Task

/open-api/v1/a1/tasks/{taskId}

Note:

  1. You can wait for 5 seconds and then query the result through polling

  2. The state enum of task can be seen in TaskStateType

Query task execution results

Request Parameters

Field Name

Type

Location

Is Mandatory

Meaning

apiKey

string

header

Yes

API key

taskId

string

path

Yes

taskId returned by the generate image interface

Parameter limit

  • Only query tasks under the current user ID

Request example

curl --location --request GET 'https://a1.art/open-api/v1/a1/tasks/{taskId}' \
--header 'apiKey: {apiKey}' \
--header 'Accept: */*' \
--header 'Host: a1.art' \
--header 'Connection: keep-alive'

Response example

{
    "code": 0,
    "msg": "success",
    "msg_cn": "成功",
    "data": {
        "id": "1803970662304264194",
        "state": 10,
        "startDate": "2024-06-21 09:58:16.0",
        "finishDate": "2024-06-21 09:58:28.0",
        "createDate": "2024-06-21 09:58:16.0",
        "images": [
            "imageUrl"
        ]
    }
}

Error code

code

msg

msg_cn

0

success

成功

10001

invalid params

无效的参数

10002

unsupported image suffix

不支持的文件后缀

10410

Missing API key

缺少API key

10411

Invalid API key

无效的API key

20000

too may request

接口访问触发限流

20002

server error

服务器错误

20003

service internal error

服务内部错误

20100

file error

文件异常

20101

file suffix error

文件后缀异常

324010

This app does not support API access

此应用不支持通过API访问

324011

The quantity must not exceed 4

单个应用单次请求生图数量1~4张

324012

This app does not exist

无效的应用ID

324013

The application is updated. You need to obtain the application information again

应用版本已更新,请重新获取应用信息

400000

Missing image file

缺少图片文件

400001

Only one image can be uploaded at a time

一次只支持上传一张图片

400002

Non image format files are not supported

不支持非图片格式文件

400003

The image file cannot exceed 10M

图片文件不能超过10M

400004

Invalid file

无效的文件

Contact us

  • Join our Discord community to communicate with our team and get quick assistance with your issues.

  • For any questions, send us an email at contact@A1.art, and we will respond within 2 business days.

  • Follow our X account: @A1.art

Last updated