For the complete documentation index, see llms.txt. This page is also available as Markdown.

Oz API Configuration

The configuration settings are contained in the config.py file.

Initial configuration

These parameters are mandatory. Please note: if you require the Instant API mode (with no data saved anywhere), set OZ_APP_COMPONENTS=stateless. Otherwise, to save data for orders and analyses, set OZ_APP_COMPONENTS=auth,stateful,oz_collections, where:

  • auth is an authentication module,

  • stateful is a module for full API,

  • oz_collections is a module for the blacklist analysis (remove if you don't use it).

# application components list
OZ_APP_COMPONENTS=auth,stateful,oz_collections
# enable local storage support
OZ_LOCAL_STORAGE_SUPPORT_ENABLE=false
# tfss service host
OZ_SERVICE_TFSS_HOST=http://xxx.xxx.xxx.xxx:xxxx
# allowed hosts
APP_ALLOWED_HOSTS=example-host1.com,example-host2.com
# secret key
OZ_API_SECRET_KEY=long_secret_key

Postgres connection

This is needed only if you use the full API version.

Path to media files

All incoming media files are saved in the local directory mounted to one of possible endpoints depending of the installation method:

  • host server or Docker container: /opt/gateway/static

  • in case of standalone installer: /var/lib/docker/volumes/api_oz-api-static-vol/_data

  • any path specified via configuration

In most of the integration cases, the media files can be accessed in web using the direct links to randomly generated filenames.

To access the media, you need to specify in the configuration file their external host name or IP address, port, and connection protocol.

Connection to Oz Bio / Liveness

OzCapsula configuration parameters

Timing and limits

To prevent TFSS overload, you can now manage the number of concurrent requests API sends to TFSS. This is done via the OZ_SERVICE_TFSS_CONCURRENCY_LIMIT_MODE parameter. Please check the possible options below.

Value
Description
Additional parameters to set

OFF

Default; no limits applied

-

TOTAL

A shared limit for all analysis types

Set the limit in OZ_SERVICE_TFSS_CONCURRENCY_LIMIT (default: 0)

SEPARATE

A limit for each analysis type

Set the limit for each of the analyses:

  • OZ_SERVICE_TFSS_CONCURRENCY_LIMIT_QUALITY,

  • OZ_SERVICE_TFSS_CONCURRENCY_LIMIT_BIOMETRY,

  • OZ_SERVICE_TFSS_CONCURRENCY_LIMIT_COLLECTION.

On exceeding the limit, the API returns HTTP 429 Too Many Requests.

Last updated

Was this helpful?