TypeScript

Call the bridge with fetch and an API token.

const res = await fetch(base + '/open-bot/chat', {
  method: 'POST',
  headers: {
    authorization: 'Bearer ' + token,
    'content-type': 'application/json',
    accept: 'text/event-stream',
  },
  body: JSON.stringify({ message: 'Hello', stream: true }),
});