API overview
Use Personal Access Tokens to connect external clients to Pegasus.
External apps can authenticate with Pegasus using a Personal Access Token (PAT) and do only what the scopes you pick allow.
API access is available on Pro and Ultra plans. Free workspaces see an upgrade prompt instead of the token form.
What you can use it for
- Build an internal tool that chats with a Pegasus bot.
- Read usage data from another system.
- Manage bots or documents, if the token has write scopes.
- Run automation in your Personal workspace or a team workspace.
OpenAI-compatible clients
This page covers creating and managing tokens in the app. To call a Pegasus bot from curl, the official OpenAI SDKs, or another OpenAI-compatible tool, see the OpenAI-compatible API guide.
Not available yetComing soon
We're working on this. Check back later, or ask your workspace owner for the latest status.
Fuller developer docs and an API playground are coming. For chat completions and the model list, you can already use the OpenAI-compatible API guide.
Keep tokens safe
Treat tokens like passwords. Anyone with a token can call the API as you, within its scopes.
Create a token
Create tokens in Settings → API Tokens.
API access requires Pro or Ultra. If you see "Upgrade to use the API", switch to a workspace on an eligible plan, or upgrade.
Open Settings
Go to Settings and choose the API Tokens tab.Click Create token
A dialog asks for a name, scopes, and expiry.Name the token
Name it for its purpose, such as "Production API client".Pick scopes
Pick as few as you can. You cannot change scopes later.Choose expiry
Pick 30, 60, 90, 180, or 365 days.Copy and save
Pegasus shows the token only once. Save it before you close the dialog.
Presets
- OpenAI-compatible chat API - for sending messages.
- Read-only - for reporting or monitoring.
- Bot management - broader access, for trusted automation.
Scope reference
Scopes limit what a token can do. Pick the fewest that still let your app work.
| Scope label | Use |
|---|---|
| Read your profile | Read basic profile information. |
| Read your subscription | See plan and quota information. |
| Read available models | List models the workspace can use. |
| Read bots & documents | List bots and read document details. |
| Create, update, delete bots | Manage bots and documents. |
| Read API conversations | Read conversations created through the API. |
| Create, delete API conversations | Create or delete API conversations. |
| Send chat messages | Send messages to bots. |
| Read usage analytics | Read usage reports. |
What each preset includes
- OpenAI-compatible chat API: the conversation and message scopes chat needs.
- Read-only: the read scopes for profile, subscription, models, bots, and usage.
- Bot management: bot read and write, plus the supporting read scopes.
You cannot edit scopes after creating a token. Revoke it and create a new one.
Tokens belong to a workspace
A new token is tied to the workspace you are in when you create it.
Personal tokens
Create the token while in your Personal workspace. It acts as you on your personal bots, conversations, usage, and plan.
Team tokens
Switch to a team workspace, then create the token. It works within that team and follows the team's role, seat, read-only state, and quota.
Read-only teams
If a team is pending cancellation or its quota is disabled, Pegasus can block new tokens and show: "Team API access is read-only".
Where to create a token
- Personal automation: in your Personal workspace.
- Team chatbot automation: in the team workspace.
- Reports on team usage: in the team workspace, with the usage read scope.
- Testing: a short-lived token, in the workspace you will test in.