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:
- 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.
- A copy of the code:
git clone https://github.com/openbot-build/openbot.gitcd openbotRun every command from the top folder of the code, inside devenv shell --.
Start OpenBot
Make the local settings
devenv shell -- pnpm dev:setupdevenv shell -- mkcert -installThe 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
devenv shell -- pnpm devThis 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
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
curl -b cookies.txt \ -H 'Origin: https://localhost:8443' \ -H 'Content-Type: application/json' \ -d '{"name":"local"}' \ https://localhost:8443/v1/user/tokensYou 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:
export OPENBOT_TOKEN=obut_...Start a Session and a Turn
Make a Session:
curl -H "Authorization: Bearer $OPENBOT_TOKEN" \ -H 'Content-Type: application/json' \ -d '{"title":"My first Session"}' \ https://localhost:8443/v1/sessionsTake session.id and session.revision from the answer. Then give the Session some work:
curl -H "Authorization: Bearer $OPENBOT_TOKEN" \ -H 'Content-Type: application/json' \ -d '{"expected":0,"input":"Hello"}' \ https://localhost:8443/v1/sessions/<sessionId>/turnsThe 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
- Read how Sessions and Turns work.
- Use a real identity provider: Authentication.
- Add a real model: Models.
- Run OpenBot on a server: Deploy.