Peltarion APIs

The Peltarion APIs allow you to automate interactions with the platform. Use it to integrate model training and model predictions into your own applications.

What can you do with the Peltarion APIs?

  • Upload datasets with the Data API

    This API lets you create a new dataset and upload files to it.
    You can’t delete existing datasets, download or list existing data.

  • Ask your models for predictions with the Deployment API

    This API lets you submit samples to an enabled deployment and get the predictions from the model (within the amount of the API limitations). You can also list the model’s inputs and outputs with type, shape, and name.
    You can’t enable or disable a deployment, train, download, or see the architecture of the deployed model from the API.

How can you use the Peltarion APIs?

Our Data and Deployment APIs use HTTP endpoints to provide an interface between your application and the Platform. This allows you to send requests to specific URLs, including, if needed, examples or data files. Our APIs then return standard HTTP codes, and JSON formatted text with the required content.

In this documentation, we provide practical examples for using the APIs in cURL, Python, and using our Python package sidekick.

You can also download our Deployment API specification and a Data API Postman collection.

Authentication

Every time you call the Peltarion APIs, your requests must contain a valid token, or they will be rejected. Tokens are codes that your applications can use to be granted access, without using your personal username and password.

Tokens only allow access to limited parts of the Platform. A specific data token lets you to work with datasets inside a specific project. A specific deployment token lets you interrogate a specific deployed model.

Keep it hidden, keep it safe

Keep in mind that anyone who knows one of your tokens can use it, even people outside of your organization.
So avoid sharing your tokens with unintended people, and avoid hardcoding them into your applications.

Using tokens

Authentication is done by specifying your token in the header of each API call that you make.

In cURL, you use the -H option to define an Authorization header:

-H "Authorization: Bearer <token>"

In Python, you add the Authorization entry in the headers option:

import requests

headers = '{"Authorization": "Bearer <token>"}'

response = requests.request("POST", headers=headers, url, data=None)

In sidekick, you use the token option when you create a client.

import sidekick

client = sidekick.Deployment(url=address, token='<token>')