You give Peel a URL and instructions
A build starts with a singlePOST /v1/apis call:
url is the source. instructions describe the API surface you want. The same build record later drives every public adapter: REST, MCP, CLI, and exported OpenAPI.
Build time is where Peel does the hard work. It can inspect pages, network traffic, selectors, and official public surfaces before deciding what can become a stable API. Runtime is intentionally narrower: it executes only the endpoint contract that was published.
A build moves through a lifecycle
Every API has astatus that tells you whether it is callable yet:
| Status | Meaning |
|---|---|
queued | The build is accepted and waiting to run. |
running | The build is in progress. |
needs_input | The build paused. Send the requested payload through POST /v1/apis/{api_id}/respond. |
completed | The contract passed publication gates and is callable. |
failed | Peel did not publish an API. Inspect failure_reason_code, failure.non_publishable_reason, and failure.artifact before deciding whether to revise or rebuild. |
matched: true on the create response means Peel reused an existing compatible API instead of starting a new build.
Endpoints publish a contract
A completed API exposes one or more endpoints underapi.endpoints. Each entry gives you the endpoint name, schemas, auth requirement, compiled target method, and often runtime policy or verification diagnostics. Treat that contract as the source of truth for payloads and target behavior across every public surface.
For the full field list, see How it works.
The runtime route is always:
rebuild to compile from fresh evidence.
The auth boundary is per endpoint
Every endpoint declares anauth_requirement:
public: call it directly with your PeelX-API-Key.session_required: call the API’sloginendpoint first, then passsession_idandencryption_keyon later calls.
auth_mode, auth, and requires_session fields summarize the API as a whole, but the per-endpoint requirement is what you check before each call. Host auth is covered in Authentication. The compiled family view (api.auth) is documented in Authenticated APIs.
You update an API with revise or rebuild
Once an API exists, you have two ways to change it:revise: keep the same source URL, change the instructions. Use when the target is right but the build intent needs to change. Billed whether or not the revision succeeds.rebuild: keep the same instructions, refresh the build evidence. Use when the site changed or runtime health recommends it. Not charged directly; runtime calls on the rebuilt contract are charged normally.
api.id, so existing callers do not need to migrate. The decision rules are in API updates. Per-operation costs are in Credits and limits.