Logo

Programmatic Authentication with Bailo

Public Key Infrastructure (PKI)

Bailo supports PKI‑based authentication. The Python client can sign requests using certificates.

from bailo import PkiAgent, Client

pki_agent = PkiAgent()

Client(
    "http://127.0.0.1:8080",
    cert="path/to/cert.pem",
    key="path/to/key.pem",
    auth="path/to/certificate/authority/file.pem"
)

Token‑based authentication

If you are not using PKI then Bailo allows the usage of access tokens to allow for fine-grained access. Tokens are used to grant access to models within Bailo to specific models and specific actions. These can be found in Settings > Authentication.

Authentication tab listing personal access tokens and add token button

To create a new access token, press Add token and select the options from below.

  • image:read pull Docker images from Bailo
  • file:read download files from Bailo

Copy and paste the Access Key and Secret Key and store these safely.

popup confirming token creation

Using tokens with the Python client

from bailo import TokenAgent, Client

token_agent = TokenAgent(ACCESS_KEY, SECRET_KEY)

Client("http://127.0.0.1:8080", agent=token_agent)

Base Agent

The full Python docs for the Agent class and subsequent child-classes is available here. It is possible to pass kwargs to the base Agent class such as verify.


Copyright © Crown Copyright 2026.