Explore documentation
Getting started with AI SRE API
How AI SRE API works
Our API follows the JSON:API specification.
API requests to the AI SRE API are authorized using the Bearer Authentication standard: add an Authorization: Bearer $TOKEN header to your requests. The AI SRE API uses the same tokens as the Telemetry API.
Chats run asynchronously. Create a chat or reply to one and the request returns as soon as your message is saved, with the chat in the processing status. Then:
- Poll the chat status until it leaves
processing. - When the status is
awaiting_confirmation, approve or deny each pending confirmation. The agent then continues and the status returns toprocessing. - When the status is
idle, get the chat and read the lastaimessage. Itstextcarries the answer as markdown and itsartifactscarry any reports.
Write requests to the AI SRE API are limited to 100 per minute per token.
Get a global API token
A global API token is a token valid across all your teams, for managing anything within Better Stack.
- Go to Better Stack → API tokens
- Copy an existing token or create a new one in the Global API tokens section.
Get a Telemetry API token
A Telemetry API token is a team-scoped token for managing your Telemetry resources, including AI SRE chats. You can get a separate API token for each of your teams.
- Go to Better Stack → API tokens → Team-based tokens
- Select your team.
- Copy an existing token or create a new one in the Telemetry API tokens section.