Use the API

Authenticate to the BSQAI API, select the correct tenant, and make a first request.

Agentic Friendly

Use the BSQAI API from applications, scripts, and developer tools. It is the integration boundary for platform capabilities; do not connect application code directly to internal model gateways or storage services.

Before you begin

Obtain your installation's API address, a valid credential, and permission for the operation you want to perform. Examples below use https://api.<platform-domain>/v1; replace the domain with your deployment's address.

Choose a credential

CredentialUse it whenTenant context
API keyConnecting a tool or script with a key created for your accountBound to the tenant selected when the key is created
JWT access tokenIntegrating with the platform's sign-in flowSelect an authorized tenant when the account belongs to more than one

Create an API key from Portal → Chat & Work → API Keys. The full key is shown once. Keep it out of source code and shared logs. Creating a key does not grant additional roles or access to other tenants.

Both credentials can be sent as Authorization: Bearer <credential>. API keys also support the X-Api-Key header. For JWT acquisition and version-specific header compatibility, use the developer authentication guide.

Make a first request

List the models exposed by your installation:

export BSQAI_BASE_URL="https://api.<platform-domain>/v1"
export BSQAI_API_KEY="<your-api-key>"

curl --fail-with-body "$BSQAI_BASE_URL/models" \
  -H "Authorization: Bearer $BSQAI_API_KEY"

Check that the request succeeds and returns the expected model IDs. Use an ID from that response in subsequent model requests; a model's display name is not necessarily its API ID.

Tenant selection

A tenant is identified by its Keycloak Organization UUID. With a JWT belonging to more than one organization, send the selected UUID in X-Tenant-Id:

export BSQAI_TOKEN="<jwt-access-token>"
export BSQAI_TENANT_ID="<keycloak-organization-uuid>"

curl --fail-with-body "$BSQAI_BASE_URL/models" \
  -H "Authorization: Bearer $BSQAI_TOKEN" \
  -H "X-Tenant-Id: $BSQAI_TENANT_ID"

The header is optional when the JWT has exactly one organization membership. Browser WebSocket clients use the tenant_id query parameter because they cannot set custom handshake headers. An API key's tenant is resolved from the key; the key cannot be moved to another tenant with this header.

Continue with your task

On this page