Skip to content

Quick start

This page starts OpenBot on your computer with a test account and test models. You do not need an identity provider or a model key.


Prerequisites

You need:

  1. devenv 2.0 or newer. It gives you the right Node.js, pnpm, PostgreSQL, and mkcert. devenv also runs the development database, so you do not need Docker.
  2. A copy of the code:
Terminal window
git clone https://github.com/openbot-build/openbot.git
cd openbot

Run every command from the top folder of the code, inside devenv shell --.


Start OpenBot

Make the local settings

Terminal window
devenv shell -- pnpm dev:setup
devenv shell -- mkcert -install

The first command makes .env.development with new secrets, and a certificate for localhost. The second command makes your computer trust that certificate. It can ask for your password.

Start the server

Terminal window
devenv shell -- pnpm dev

This starts PostgreSQL, builds OpenBot, updates the database, and starts OpenBot at https://localhost:8443. The first start can take a few minutes. Press Ctrl+C to stop. Your data stays in the database.

Sign in

Terminal window
curl -c cookies.txt -X POST https://localhost:8443/auth/development/sign-in \
-H "Origin: https://localhost:8443" \
-H "Content-Type: application/json" \
-d '{}'

In development, this signs you in to a local test account at once. The sign-in cookie goes to cookies.txt.

Make a user token

Terminal window
curl -b cookies.txt \
-H 'Origin: https://localhost:8443' \
-H 'Content-Type: application/json' \
-d '{"name":"local"}' \
https://localhost:8443/v1/user/tokens

You are the first account, so you are the Super Administrator of the organization. The answer has a secret that starts with obut_. You see it only once, so keep it:

Terminal window
export OPENBOT_TOKEN=obut_...

Start a Session and a Turn

Make a Session:

Terminal window
curl -H "Authorization: Bearer $OPENBOT_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"title":"My first Session"}' \
https://localhost:8443/v1/sessions

Take session.id and session.revision from the answer. Then give the Session some work:

Terminal window
curl -H "Authorization: Bearer $OPENBOT_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"expected":0,"input":"Hello"}' \
https://localhost:8443/v1/sessions/<sessionId>/turns

The Turn runs in the background and you get 202 at once. Add "stream": true to get the answer as a live stream.

The test model mock-text answers with Development response: and your input. See Models for the other test models.


Next steps