Overview

Each endpoint you create is accessible via a RESTful API that we automatically launch, monitor, and autoscale based on your utilization.

Each RESTful API request you send must be authenticated. It will include the data you are intending to process (e.g., a link to an image, a base64-encoded image, or a snippet of text) in JSON format.

Model Configuration

Optionally, some models in an endpoint can be configured with specific parameters sent in the API request. These are sent by passing an additional config key in your JSON request, for example:

{
    ...
    "config": {
        "<model-name>": {
             ...
        }
    }
}

For further details about how to configure your models, please review the model details below.

Timing

Each API request will include precise timing information for you to monitor API performance (on top of the performance monitoring in your Pretrained.ai dashboard).

Timing information will be formatted like so, alongside the rest of the response from the model(s).

{
    "elapsedTime": {
        "total": <total-elapsed-time>,
        "models": {
            "model-1": <elapsed-time>,
            "model-2": <elapsed-time>
        }
    },
    "response": {
        ...
    }
}