Skip to main content
POST
/
api
/
v1
/
client
/
job
/
detect-face-image
Create an image face detection task
curl --request POST \
  --url https://api.crun.ai/api/v1/client/job/detect-face-image \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "image_url": "https://example.com/source.png"
}
'
{
  "code": 200,
  "message": "success",
  "data": {
    "detect_task_id": "dit60yt8reqplt1c16"
  }
}

Overview

Before multi-face swap, call this endpoint to create an image face detection task. The endpoint returns detect_task_id; call the face detection result endpoint to query status and retrieve detect_id with the detected face list after success.

API Endpoint

POST https://api.crun.ai/api/v1/client/job/detect-face-image

Request Parameters

image_url
string
required
URL of the image to detect faces from.

Request Example

curl -X POST "https://api.crun.ai/api/v1/client/job/detect-face-image" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -d "{\"image_url\":\"https://example.com/source.png\"}"

Response Example

{
  "code": 200,
  "message": "success",
  "data": {
    "detect_task_id": "dit60yt8reqplt1c16"
  }
}

Next Step

Query Face Detection Result

Query detection status and get the detect_id and faces list required for multi-face swap

Image Multi-Face Swap

Replace selected faces in an image using detect_id and faces

Face Detection Result

Query detection status and retrieve the face list

Authorizations

x-api-key
string
header
required

All APIs require authentication via API Key.

Get API Key:

  1. Visit API Key Management Page to get your API Key

Usage: Add to request header:

x-api-key: YOUR_API_KEY

Note:

  • Keep your API Key secure and do not share it with others
  • If you suspect your API Key has been compromised, reset it immediately in the management page

Body

application/json
image_url
string<uri>
required

URL of the image to detect faces from.

Example:

"https://example.com/source.png"

Response

Request successful

code
enum<integer>

Response status code

  • 200: Success - Request has been processed successfully
  • 401: Unauthorized - Authentication credentials are missing or invalid
  • 402: Insufficient Credits - Account does not have enough credits to perform the operation
  • 404: Not Found - The requested resource or endpoint does not exist
  • 422: Validation Error - The request parameters failed validation checks
  • 429: Rate Limited - Request limit has been exceeded for this resource
  • 455: Service Unavailable - System is currently undergoing maintenance
  • 500: Server Error - An unexpected error occurred while processing the request
  • 501: Generation Failed - Content generation task failed
  • 505: Feature Disabled - The requested feature is currently disabled
Available options:
200,
401,
402,
404,
422,
429,
455,
500,
501,
505
message
string

Response message, error description when failed

Example:

"success"

data
object