- Build an API.
- Inspect its contract.
- Call one endpoint.
peel setup signs in with an existing account, offers MCP installation, and runs a quick health check. See CLI for the full command surface.
1. Build an API
api object alongside build metadata. The links entries are relative API paths; resolve them against https://api.peel.sh or your configured PEEL_API_BASE. IDs below are abbreviated for readability.
If Peel cannot publish a trustworthy endpoint, the API moves to failed with failure_reason_code and a structured failure.artifact. That is expected behavior: a failed build is better than a misleading API contract.
status moves through queued, running, optionally needs_input, then completed or failed. See Core concepts for the full lifecycle.
wait_for_completion: true blocks the request until the build reaches a terminal state, up to timeout_ms (max 120000). If the build is still running at the cap, the response returns timed_out: true with the API record in its current state. In that case, fall back to polling.
matched: true means Peel reused an existing compatible API for this URL instead of starting a new build. To opt out and force a fresh compile, pass "force_new": true in the request body. Matched builds are free. They reuse the same api.id, and no credits are charged.
Save the api.id so the next step can reference it:
api.id.
Polling when you don’t block
If you omitwait_for_completion or the blocking call times out, poll the detail endpoint until status is terminal:
2. Inspect the contract
Before you call anything, fetch the API detail record. It contains the endpoint names and schemas you should use.statusmust becompleted.endpoints[].endpoint_nameis the exact name you pass to the runtime route.endpoints[].input_schemashows the payload shape Peel expects.endpoints[].runtime_policyandendpoints[].runtime_verificationshow the deterministic runtime constraints and build-time verification evidence Peel has for that endpoint.
url is the URL you passed to POST /v1/apis, and source_url is the URL Peel’s compiled transport actually fetches. They usually match, but they can differ if the build normalized or followed the input URL. Use source_url when you need to know where runtime goes.
For the full set of published fields, see How it works.
CLI equivalent:
3. Call an endpoint
Use the publishedendpoint_name and send the request body in the shape described by input_schema.
404 with an available_endpoints array in the body. Copy a name from there.
CLI equivalent:
Handle a paused build
Ifstatus is needs_input, Peel is waiting for more information. The detail response includes user_input_prompt describing what it needs:
/respond and wait for the build to resume:
/respond returns 409 if the API is not currently in needs_input. Re-fetch the detail record after the call to confirm the new status before making runtime calls.
needs_input is a terminal state for the build worker. Peel does not automatically time it out. A paused API stays in needs_input until you call /respond, /revise, or /rebuild.
CLI equivalent:
Where to go next
- List what you have built:
GET /v1/apis?limit=20returns your APIs and supportslimit,cursor, andstatus. - Use the same flow from the terminal: CLI covers
peel build,peel apis,peel call,peel revise, andpeel rebuild. - Change or refresh this API later: see API updates for
reviseandrebuild. - Use it from an agent: see MCP server to expose the same API as MCP tools.
- Understand billing: see Credits and limits for per-operation costs and rate limits.
Troubleshooting
If a call returns an error, see Errors for the full catalog of HTTP status codes, runtimeerror_code values, and recovery steps.