> For the complete documentation index, see [llms.txt](https://api2-ekycapis.innov8tif.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api2-ekycapis.innov8tif.com/okaylive/okaylive-all/anti-spoofing/versions.md).

# Versions

## Version 1

<mark style="color:green;">`POST`</mark> `https://okaylivefacedemo.innov8tif.com/api/check_liveness`

#### Request Body

| Name                                     | Type   | Description                                     |
| ---------------------------------------- | ------ | ----------------------------------------------- |
| apiKey<mark style="color:red;">\*</mark> | string | To be assigned by Innov8tif                     |
| data<mark style="color:red;">\*</mark>   | object | The binary image data uploaded as a file        |
| Meta                                     | string | The JSON string with device information         |
| X-Meta                                   | string | The JSON string with any additional information |

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

```
{    
    "probability": 0.99,    
    "score": 9.0,    
    "quality": 1.0 
}, 
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
"Meta" parameter is not required but it can significantly decrease overall error rate. The current version of API supports mobile OS setting.
{% endhint %}

{% file src="/files/OGa0ZpRbekroGppqBhwa" %}
OkayLive-AntiSpoofing
{% endfile %}

| Meta Key    | Meta Value                    | Required |
| ----------- | ----------------------------- | -------- |
| OS          | "IOS", "ANDROID" or "UNKNOWN" | True     |
| MANUFACTURE | "UNKNOWN"                     | False    |
| MODEL       | "UNKNOWN"                     | False    |

> If you're not sure about the device meta, please set 'UNKNOWN' value or just not to pass 'Meta' in the header.

### Interpretation of Result

| Key         | Value                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| probability | Probability of liveness                                                                                                                                                                                                                                                                                                                                                                                                                    |
| score       | <p>Linear liveness score: bigger value means more alive,</p><p><strong>(not suggested as a threshold to detect the liveness.)</strong></p>                                                                                                                                                                                                                                                                                                 |
| quality     | <p>The quality score of the selfie image ranges from 0 (bad) to 1 (good). If the quality score is less than 0.5, the image should be rejected in most cases. <br>The "quality" refers to the eligibility of the image as input for the liveness check.<br><br>Please refer to the "<a href="/pages/HUKbyCgaathuDOlZcfuS"><mark style="color:orange;">Image Requirement</mark></a>" section to get the best result for each API return.</p> |
| error       | Error message from the server                                                                                                                                                                                                                                                                                                                                                                                                              |

{% hint style="danger" %}
The response of  "**score**" and "**quality**" is NOT suggested to be used for the decision making for detection result.
{% endhint %}

* Probability of liveness is a main response of the system.
* &#x20;The image is accepted as "live" when a ***probability*** is ***bigger*** than ***0.5***.
* &#x20;Linear liveness score can be used for BPCER / APCER tuning. The range of **score** is (ln 1e-7, -ln 1e-7).
* Quality value is a probability of "appropriate image".
* Probability can be ***lower*** than ***0.5*** by the reasons below.
  * Face minimal side is less than 180 pix or distance between eyes is less than 90 pix.
  * Face out-of-plane rotation is bigger than 20 degrees.
  * The distance between face and camera is very small, so the face can be significantly distorted.
  * The luminous power is insufficient.
  * High motion or gaussian blur rate or light shot.

{% hint style="info" %}
We highly advise to analyze quality value and reject inappropriate images.
{% endhint %}
