Token API
GET https://llmfoundry.straive.com/token
returns the LLMFoundry token for the user. This can be used to authenticate with the API. For example:
const token = await fetch("https://llmfoundry.straive.com/token", { credentials: "include" }).then((r) => r.json());
If the user is not logged in as a valid user, this returns an empty object. Otherwise, it returns:
{
"email": "user.name@straive.com",
"token": "..."
}
To redirect the user to the login page, use https://llmfoundry.straive.com/login?next=https://your-site.com/
Tutorial
See the Single Page LLM Apps Workshop for a step-by-step tutorial.