API overview
Automate PentAGI over REST and GraphQL — create a Bearer token, start flows from CI/CD, pull results into your own tools and generate a client.
Most of what you can do in the web UI is available through the API — start flowsflowOne run of PentAGI: a goal, the tasks created from your messages, and everything the agents did along the way. from CI/CD, pull results into your own tools or build integrations.
| API | Endpoint | Interactive docs |
|---|---|---|
| GraphQL | / | / |
| REST | / | / |
Create a token
- Open Settings → API Tokens in the web UI.
- Click Create Token, optionally name it and set an expiration between 1 minute and 3 years.
- Copy the token right away — it is shown only once.
A token belongs to your account and inherits your role's permissions. Users, roles and API tokens, flow templatestemplateSaved text that PentAGI reuses. A template saved in Templates fills in the first message of a new flow; in Enterprise, a report template sets the sections of a report and their order, so different templates produce different documents for the customer, the engineers and management., favorites and your settings are managed only from a signed-in browser session: a token gets 403 on the REST /, / and / routes and an error from those GraphQL operations.
Call the API
curl -X POST https://your-pentagi-host:8443/api/v1/graphql \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "{ flows { id title status } }"}'
curl https://your-pentagi-host:8443/api/v1/flows/ \
-H "Authorization: Bearer YOUR_API_TOKEN"Start a flow with a GraphQL mutation:
mutation CreateFlow {
createFlow(modelProvider: "openai", input: "Test the security of https://example.com") {
id
title
status
createdAt
}
}Generate a client
- GraphQL — the schema is
backend/in the repository; use GraphQL Code Generator, genqlient or Apollo.pkg/ graph/ schema.graphqls - REST — the OpenAPI spec is served at
/:api/ v1/ swagger/ doc.json
openapi-generator-cli generate \
-i https://your-pentagi-host:8443/api/v1/swagger/doc.json \
-g python \
-o ./pentagi-clientLast updated on
Troubleshooting
Fixes for common PentAGI problems — a flow that fails on its first model call, tool-call parser errors, macOS installer warnings and stalled small models.
Enterprise overview
What PentAGI Enterprise 3.0 adds to the open-source edition — agent profiles, plugins and MCP servers, customer-ready reports and a live attack-chain view.