الانتقال إلى المحتوى الرئيسي
POST
/
headshots
/
generate
Generate
curl --request POST \
  --url https://api.acedata.cloud/headshots/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "template": "business_photo",
  "mode": "fast",
  "image_urls": [
    "https://cdn.acedata.cloud/4hfydw.jpg"
  ]
}
'
import requests

url = "https://api.acedata.cloud/headshots/generate"

payload = {
"template": "business_photo",
"mode": "fast",
"image_urls": ["https://cdn.acedata.cloud/4hfydw.jpg"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template: 'business_photo',
mode: 'fast',
image_urls: ['https://cdn.acedata.cloud/4hfydw.jpg']
})
};

fetch('https://api.acedata.cloud/headshots/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "data": [
    {
      "id": "202410231117",
      "template": "男形象照",
      "image_url": "https://static.aipedias.com/aicamera/...."
    },
    {
      "id": "2024102311170",
      "template": "男形象照",
      "image_url": "https://static.aipedias.com/aicamera/...."
    }
  ],
  "success": true,
  "task_id": "5636d6ba-957f-475e-a98a-718a07ee89a6"
}
{
"error": {
"code": "bad_request",
"message": "The json payload is not valid to request the API"
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
"error": {
"code": "invalid_token",
"message": "The specified token is invalid or wrong."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
"error": {
"code": "forbidden",
"message": "Sorry! Our Al moderators feel your prompt might be against our community standards."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
"error": {
"code": "too_many_requests",
"message": "You have exceeded the rate limit."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
"error": {
"code": "api_error",
"message": "Internal server error."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
"error": {
"code": "timeout",
"message": "Timeout to generate the image."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}

التفويضات

Authorization
string
header
مطلوب

الترويسات

accept
enum<string>

Headshots Generate Param Accept

الخيارات المتاحة:
application/json

الجسم

application/json
mode
enum<string>
افتراضي:fast
مطلوب

Headshots Generate Mode

الخيارات المتاحة:
fast,
relax
template
enum<string>
مطلوب

Headshots Generate Template

الخيارات المتاحة:
male_portrait,
male_portrait2,
kindergarten,
logo_tshirt,
wedding,
business_photo,
bob_suit,
female_portrait
image_urls
string[]
مطلوب

Headshots Generate Image Urls

callback_url
string

Headshots Generate Callback Url

async
boolean

Headshots Generate Async

الاستجابة

Headshots Generate Response 200

data
object[]

Headshots Generate Response 200 Data

success
boolean

Headshots Generate Response 200 Success

task_id
string

Headshots Generate Response 200 Task Id