API for Agents

Tokens, first calls, and the OpenAPI playground for agent builders

PetroBench API

Versioned REST for agents and integrations. Same permissions as your users.

What it is

A versioned REST surface at app.petrobench.com/api/v1. Same auth and abilities as MCP - raw HTTP when you need full control.

What it does

Lets agents and scripts call wells, simulations, and account endpoints with the same scopes as your users. Admin enables the feature flag.

  • Tokens & OAuth

    PATs, service tokens, or OAuth clients

  • Exact HTTP

    Versioned REST for agents and scripts

  • OpenAPI playground

    Try endpoints with your Bearer token

Base URL

API base
https://app.petrobench.com/api/v1

Mint a token

Agents should prefer service tokens for long-lived automation and PATs for personal experimentation.

1

Create a token

In the platform: Settings → API Keys (or division Service Tokens). Grant only the abilities you need.

2

Smoke-test

curl -sS -H "Authorization: Bearer $PB_TOKEN" \
  https://app.petrobench.com/api/v1/me
3

Open the playground

Browse generated endpoints and paste the same Bearer token into the auth banner.

Agent-friendly habits

  • Send Authorization: Bearer <token> on every call.
  • Multi-org users: set X-Organization-Id when required (see Authentication).
  • Respect rate limits and surface Retry-After to your agent loop.
  • Prefer idempotent reads first; gate writes behind human approval in the agent policy.

Next

On this page