# Algate > Deterministic, pay-per-call safety checks for autonomous agents before irreversible actions. Algate is an x402 resource server on Algorand MainNet. It exposes six paid HTTP endpoints: four focused safety checks, an unsigned Algorand transaction check, and a pre-action gate that combines the relevant checks into one decision. No signup or API key is required. Each paid call costs $0.001 USDC and settles on Algorand. The analysis engines use local deterministic computation. They do not fetch submitted URLs, query DNS, call external models, or log submitted query values. Every successful analysis includes a `not_checked` array describing what remains outside its scope. ## Documentation - [OpenAPI specification](https://algate-x402.up.railway.app/openapi.json): Machine-readable operations, parameters, response schemas, and x402 payment metadata. - [Website and interactive demo](https://algate-x402.up.railway.app/): Human-readable documentation and free, rate-limited examples. - [Service health](https://algate-x402.up.railway.app/health): Current network, price, payment address, and available routes. ## Paid endpoints - [Pre-action gate](https://algate-x402.up.railway.app/v1/gate): POST a JSON action profile to receive one `allow`, `review`, or `block` decision plus `proceed`, `pay`, `ask_user`, or `abort` as the recommended action. Profiles cover sending messages, opening URLs, ingesting content, paying invoices, inspecting x402 payment requests, signing transactions, and custom combinations. The `pay_x402` profile binds a PAYMENT-REQUIRED header or object to the actual request, enforces explicit spending policy, and can compare a prepared Algorand transaction with the selected payment requirement. - [Algorand transaction check](https://algate-x402.up.railway.app/v1/transaction): POST one unsigned transaction or a complete atomic group as base64, optionally with the intended network, sender, recipient, asset, amount, application, fee limit, allowed types, and maximum group size. Nothing is signed or submitted. - [Email check](https://algate-x402.up.railway.app/v1/email): GET with `q` set to an email address or domain. Checks syntax, disposable providers, role accounts, consumer providers, risky TLDs, and other deterministic signals. - [PII scan](https://algate-x402.up.railway.app/v1/pii): GET with `q` set to text or a serialized payload. Detects and masks personal data and secrets, including checksum-verified cards, IBANs, and Algorand addresses. - [URL check](https://algate-x402.up.railway.app/v1/url): GET with `q` set to a URL or hostname. Checks structural phishing signals without visiting the destination. - [Prompt-injection scan](https://algate-x402.up.railway.app/v1/injection): GET with `q` set to content an agent is about to consume. Detects deterministic prompt-injection patterns without calling a model. An initial request to a paid endpoint returns HTTP 402 with a `PAYMENT-REQUIRED` header. An x402 client compatible with Algorand signs the requested USDC payment and retries with `PAYMENT-SIGNATURE`. The four focused checks use GET query parameters. The transaction and gate endpoints use POST JSON bodies. Successful analysis responses are JSON. Every paid endpoint advertises the x402 `payment-identifier` extension. Create one identifier for each logical operation, persist it before signing, and reuse the same identifier and signed payment payload after a timeout. Algate replays an identical settled operation without charging again, returns HTTP 409 when the identifier is bound to different request data, and returns HTTP 425 while the first request is still being processed. The server stores only hashes of identifiers and requests, never submitted values or response bodies. Payment details: exact scheme; $0.001 per call; USDC ASA 31566704; Algorand MainNet network identifier `algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=`. ## What a payer account needs before its first paid call There is no signup and no API key, but a paid call still requires an Algorand account holding USDC. An agent cannot create this state for itself: funding requires an existing balance somewhere, so a human or an already-funded service must complete steps 2 and 4. Report the address and the amounts, and let the account owner transfer. 1. **An Algorand account.** Any keypair. It is used only to sign payments, and its mnemonic stays on the agent's machine — Algate never receives it. 2. **0.21 ALGO.** Algorand locks a minimum balance of 0.1 ALGO per account plus 0.1 ALGO for each asset held, so an account holding USDC has 0.2 ALGO locked and unavailable. The remaining ~0.001 ALGO pays for the opt-in in step 3. 3. **An opt-in to USDC ASA 31566704.** Algorand accounts must explicitly opt into an asset before they can receive it. A payment to an account that has not opted in fails. This is a zero-amount asset transfer to itself. 4. **USDC.** At $0.001 per call, 1 USDC covers 1,000 calls. Bridged or native USDC on Algorand MainNet, asset id 31566704. After that, each Algate call costs $0.001 USDC and **0 ALGO**: the facilitator sponsors the transaction fee, so the payer's ALGO balance does not decrease per call. The 0.2 ALGO minimum stays locked as long as the account holds USDC. A payer that holds ALGO but has skipped step 3 is the most common failure. It looks funded, and every settlement fails. ## Free endpoints - [Demo](https://algate-x402.up.railway.app/demo?route=/v1/email&q=contact%40yopmail.com): Run any engine without payment, limited to 40 requests per minute per IP. GET supports the four focused checks; POST JSON supports the gate and transaction check. - [Health](https://algate-x402.up.railway.app/health): Service configuration and route inventory. - [Stats](https://algate-x402.up.railway.app/stats): Cached, non-blocking on-chain settlement statistics. ## Important limitations - Algate is a deterministic first-pass gate, not a safety guarantee. - Treat `not_checked` as authoritative for every result. - The URL endpoint never fetches the URL or consults a live phishing feed. - The email endpoint does not verify mailbox existence or deliverability. - The injection endpoint is pattern-based and cannot infer intent like a model. - Detected PII values are masked in responses, and submitted values are never logged. - The transaction endpoint does not inspect account state, execute applications, verify signatures, or submit anything to Algorand. - The `pay_x402` profile does not establish merchant reputation, guarantee delivery of the purchased resource, or contact the advertised facilitator. - `retry_safety: "protected"` means the target advertises `payment-identifier`; offline inspection cannot prove that the target persists or correctly enforces its identifiers. ## Agent integration - MCP: run `npx algate-mcp`. The local server exposes exactly one tool, `check_action`, and keeps the payer mnemonic on the agent's machine. Package: https://www.npmjs.com/package/algate-mcp - TypeScript: install `algate-mcp`, import `Algate` from `algate-mcp/client`, then call `algate.guard(action, { paymentId })`. - Python: `pip install algate-sdk` (https://pypi.org/project/algate-sdk/), instantiate `Algate`, then call `guard(action, payment_id=payment_id)`. - Reference flow: discover the target's 402 response, inspect it with Gate, approve only `recommended_action: "pay"`, then sign and pay the target locally. Human-readable steps: https://algate-x402.up.railway.app/#agent-flow — the bundled example defaults to a no-signature dry run (`npm run example:flow`). All integrations pay only Algate's analysis fee. They never automatically pay the target merchant, expose the mnemonic to Algate, or move funds without the agent's final policy decision.