> For the complete documentation index, see [llms.txt](https://doc.faceplugin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.faceplugin.com/integration/http-api/face-liveness.md).

# Face Liveness

Faceplugin Face Liveness HTTP API. POST /api/liveness (alias /api/check\_liveness) with a JPEG on port 8084. Score 0.5 or higher is Real. CPU only.

This API scores **one RGB JPEG** for presentation attacks. Examples include a printed photo, a screen replay, a mask, or a deepfake-style spoof.

**PAD** means presentation attack detection (anti-spoofing).

It runs on Docker image `faceplugin/face-liveness` and on the Windows app. Default port **8084**. The engine is **CPU only**.

Shared routes: [Shared endpoints](/integration/http-api/shared.md). A call without a liveness license returns `code` 8 with `licenseError`.

The combined Face Recognition + Liveness packages also expose `/api/liveness` on port **8083**. See [Face Recognition HTTP API](/integration/http-api/face-recognition.md).

Install and run: [Face Liveness Detection Linux SDK](/products/face-recognition-sdk/liveness-detection-sdk/server-sdk/liveness-detection-linux-sdk.md) · [Face Liveness Detection Windows SDK](/products/face-recognition-sdk/liveness-detection-sdk/server-sdk/liveness-detection-windows-sdk.md).

### Try it

```bash
curl -s -X POST http://127.0.0.1:8084/api/liveness \
  -H 'Content-Type: application/json' \
  -d "{\"image\":\"$(base64 -w0 face.jpg)\"}"
```

## `POST /api/liveness`

Alias: `POST /api/check_liveness`.

{% tabs %}
{% tab title="JSON" %}

```json
{ "image": "<BASE64-JPEG>", "algorithm": "all" }
```

{% endtab %}

{% tab title="form-data" %}
File field `image` (alias `file`). Optional text field `algorithm`.
{% endtab %}
{% endtabs %}

|                  |                                                                                         |
| ---------------- | --------------------------------------------------------------------------------------- |
| **Input**        | JPEG image. A missing `image` field returns envelope `code: -1` and `"image required"`. |
| **Return value** | Engine JSON. Score **≥ 0.5** means Real / `pass` true.                                  |

Example shape:

```json
{ "score": 0.72, "result": "Real", "pass": true }
```

Python:

```python
import sdk
sdk.activate("license.txt")
sdk.init_sdk()
print(sdk.liveness(base64_jpeg))
```

### Related documentation

* [HTTP API overview](/integration/http-api.md) · [Face Recognition HTTP API](/integration/http-api/face-recognition.md) · [Hosting requirements](/integration/deploy-and-host/hosting-requirements.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.faceplugin.com/integration/http-api/face-liveness.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
