Skip to main content

Getting Started with Truebar

This guide walks you through the minimal setup required to call Truebar APIs. By the end you will:

  1. Configure environment variables for the TRUEBAR_ SDK/plugin ecosystem.
  2. Retrieve an OAuth2 access token from the authentication realm.
  3. Verify connectivity with the HTTP info endpoint.
  4. (Optional) Open a streaming session using wscat.

1. Collect credentials#

  • Vitasis creates a username and password for each project environment.
  • Confirm the client ID (defaults to truebar-client unless you requested a custom realm configuration).
  • Note the target environment hostnames (see Overview).

Export the variables once in your shell profile (or .env file) so you can re-use them across SDKs, CLIs, and tutorials. The snippets below set the playground defaults; update the hostnames as described afterwards if you are targeting production.

export TRUEBAR_USERNAME="alice@example.com"export TRUEBAR_PASSWORD="super-secret-passphrase"export TRUEBAR_CLIENT_ID="truebar-client"export TRUEBAR_AUTH_URL="https://playground-auth.true-bar.si/realms/truebar/protocol/openid-connect/token"export TRUEBAR_API_BASE_URL="https://playground-api.true-bar.si"export TRUEBAR_STT_WS_URL="wss://playground-api.true-bar.si/api/pipelines/stream"export TRUEBAR_TTS_WS_URL="wss://playground-api.true-bar.si/api/pipelines/stream"
Hostname primer

Production endpoints follow the https://{service}.true-bar.si pattern—for example, auth.true-bar.si for OAuth and api.true-bar.si for REST/WebSocket calls. To target production instead of the playground, replace the playground- prefix in each hostname and leave the rest of the URL unchanged.

2. Retrieve an access token#

Use the OAuth password grant to exchange your credentials for an access token. The snippets below show the same request across common languages; choose the one that fits your tooling and run it with the TRUEBAR_ environment variables set.

curl --fail --location \  --request POST "$TRUEBAR_AUTH_URL" \  --header 'Content-Type: application/x-www-form-urlencoded' \  --data-urlencode 'grant_type=password' \  --data-urlencode "username=$TRUEBAR_USERNAME" \  --data-urlencode "password=$TRUEBAR_PASSWORD" \  --data-urlencode "client_id=$TRUEBAR_CLIENT_ID" \  | jq

Store it in an env var for re-use:

export TRUEBAR_ACCESS_TOKEN="$(curl --silent --location --request POST "$TRUEBAR_AUTH_URL" \  --header 'Content-Type: application/x-www-form-urlencoded' \  --data-urlencode 'grant_type=password' \  --data-urlencode "username=$TRUEBAR_USERNAME" \  --data-urlencode "password=$TRUEBAR_PASSWORD" \  --data-urlencode "client_id=$TRUEBAR_CLIENT_ID" \  | jq -r '.access_token')"

Save the response fields:

{  "access_token": "...",  "expires_in": 900,  "refresh_token": "...",  "refresh_expires_in": 1800,  "token_type": "Bearer"}

To refresh the token before it expires, call the same endpoint with grant_type=refresh_token and pass the refresh_token you received.

3. Verify connectivity#

Call the public /api/info endpoint to confirm that the API is reachable. It returns metadata about the deployment and provides a link to the OpenAPI specification.

curl --fail --location \  --request GET "$TRUEBAR_API_BASE_URL/api/info" \  --header "Authorization: Bearer $TRUEBAR_ACCESS_TOKEN" \  | jq

You should see fields such as version, buildTime, and openapi. If you do not, check that:

  • The token has the API role.
  • You targeted the correct environment URL.
  • Your network allows outbound HTTPS traffic.

4. Optional: test a streaming session#

Truebar exposes a WebSocket endpoint for low-latency pipelines. You can perform a smoke test with wscat (install via npm i -g wscat):

wscat \  --connect "$TRUEBAR_STT_WS_URL?access_token=$TRUEBAR_ACCESS_TOKEN" \  --execute '{"type":"CONFIG","pipeline":{"task":"ASR","config":{"tag":"en-US","parameters":{"enableInterims":true}}}}'

You should receive STATUS messages confirming the pipeline configuration. Close the connection with Ctrl+C once you are done.

Next steps#

  • Want a guided workflow? Continue with the streaming quickstarts for STT and TTS.
  • Looking for SDK usage? Visit the client libraries page.
  • Ready for production? Dive into the API reference and fine-tune your pipelines.