Skip to main content

Agentic x402 onboarding

Aient exposes paid, agent-native HTTP routes through x402. An autonomous agent can discover Aient on Coinbase Bazaar, pay with USDC, create a wallet-backed organisation, send OpenTelemetry, query detected problems, and request an AI remediation run. Use this path when the buyer is an agent or wallet principal. Use Agent-assisted setup when an assistant helps a human or team prepare a normal Aient setup without bypassing payment, integration consent, or code review.

Flow

  1. Discover Aient on Bazaar or from route metadata.
  2. Call POST /x402/signup to create a wallet-backed organisation and receive a first publishable environment key.
  3. Send OpenTelemetry to Aient with that key.
  4. Query service health, logs, traces, or detected problems.
  5. Trigger remediation for a selected problem and poll until a PR or terminal status is available.

Core routes

RoutePurpose
POST /x402/signupPay once to create a wallet-backed organisation and first environment key.
POST /x402/onboardStart the guided onboarding session when GitHub approval or instrumentation is needed.
POST /x402/diagnoseDescribe an incident and get the cheapest next action toward a real diagnosis or remediation.
POST /x402/instrumentation/prAsk Aient to open an instrumentation PR for a repository and service.
GET /x402/problemsList Aient-detected problems for the wallet-backed organisation.
GET /x402/problems/{id}Read one problem with stack traces, sample trace ids, and remediation state.
POST /x402/problems/{id}/remediationsStart an autonomous remediation run for a detected problem.
GET /x402/remediations/{id}Poll remediation status and retrieve the PR URL when it is ready.
POST /x402/resolveShortcut route for the guided onboarding flow to request a fix once telemetry is ready.
Read routes are priced low enough for agents to inspect state repeatedly. Remediation routes cost more because they consume sandbox and model work.

Session rules

POST /x402/onboard returns a session token once. Store it. Free polling routes use:
Authorization: Bearer <session_token>
Paid routes still require x402 payment. A session token is not a payment bypass. When a response includes next_actions, follow the first action unless your agent has a better operator instruction. If the next action contains x_assumed_state, pass it back on the next paid call so Aient can reject stale suggestions without charging for the wrong step.

Human approval

Some steps still require a human or admin:
  • GitHub App installation
  • repository selection
  • destructive or high-risk changes
  • reviewing and merging remediation PRs
When approval is required, Aient returns a link and a waiting state. The agent should hand that link to the operator, then poll the session until the state advances.

Remediation output

Remediation starts asynchronously. The first response returns a remediation id, thread URL, and status. Poll the remediation route until the result includes a PR URL or a terminal failure.
{
  "remediationId": "rem_01HZ...",
  "status": "awaiting-review",
  "threadUrl": "https://aient.ai/threads/thr_01HZ...",
  "prUrl": "https://github.com/org/repo/pull/42"
}
The PR is the review boundary. Aient does not ask agents to merge code automatically.