Files

Detect faces in an image or video.

Use this API to get the list of faces detected in the image or video to use in the face swap photo or face swap video API calls for multi-face swaps.

Note: Face detection is free to use for the near future. Pricing may change in the future.

post/v1/face-detection

Request

  • Base URL
    https://api.magichour.ai
  • URL
    https://api.magichour.ai/v1/face-detection
  • Auth
    HTTP bearer

Request body

confidence_scorenumber

Confidence threshold for filtering detected faces.

  • Higher values (e.g., 0.9) include only faces detected with high certainty, reducing false positives.
  • Lower values (e.g., 0.3) include more faces, but may increase the chance of incorrect detections.

Example request

{
  "confidence_score": 0.5,
  "assets": {
    "target_file_path": "api-assets/id/1234.png"
  }
}

Response

200

idstring required

The id of the task. Use this value in the get face detection details API to get the details of the face detection task.

credits_chargedinteger required

The credits charged for the task.

Example response

{
  "id": "uuid-example"
}

Changes

    • info

      added the non-success response with the status

    • info

      removed the Not Found enum value from the response property for the response status

    • info

      removed the Unauthorized enum value from the response property for the response status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the non-success response with the status