From an idea to six working API services

I recently started experimenting with a question: can autonomous AI agents use specialized data analysis services and pay for individual API requests?

With AI assistance, I developed a testnet prototype using Node.js, REST APIs and the x402 payment protocol.

The goal was to explore the technical feasibility of machine-to-machine payments and automated data review.

1. Building deterministic services

Instead of relying on a language model for every API request, the prototype uses predefined analytical rules.

Six services were implemented:

  • Duplicate invoice detection
  • Shared account attribute analysis
  • Tokenized IP overlap analysis
  • Data quality validation
  • Case timeline reconstruction
  • Grouped data review

Deterministic processing makes the results reproducible without requiring an LLM inference call for each analysis.

2. Experimenting with x402 payments

The payment infrastructure was tested using Base Sepolia and testnet USDC.

The testing process included:

  • Receiving a payment challenge.
  • Authorizing a testnet payment.
  • Verifying and settling the payment.
  • Returning a structured JSON response.
  • Testing rejection of a repeated payment authorization.

Seven internal test purchases were reported as successful. These were technical experiments, not commercial transactions or actual revenue.

3. A simple duplicate invoice example

Consider two synthetic invoice records:

ID Supplier Reference Amount
I1 V1 R1 €100
I2 V1 R1 €100

If both records share the same supplier and invoice reference, they can be flagged as potential duplicates.

Matching supplier, amount, currency and date provides another review indicator.

These indicators require further investigation. They do not automatically establish fraud.

4. Coordinating four AI agents

I also experimented with four specialized AI agents:

  • CEO — planning and decision support
  • Finance — financial reporting
  • Marketing — market research
  • Sales — commercial planning

Initially, I manually transferred reports between agents.

A Node.js orchestrator was then created to execute the agents sequentially, pass their reports to the next agent and save the results locally.

The first automated cycle completed all four sessions in 39 seconds.

A local HTML dashboard was created to display reports, execution status and recorded session costs.

5. Lessons learned

Several practical challenges emerged during development:

  • AI-generated reports can contain incomplete or inconsistent language.
  • Tool responses do not always contain the expected file contents.
  • Session spending limits require additional monitoring.
  • Successful internal tests do not establish market demand.
  • Testnet transactions must remain separate from actual financial revenue.

6. What remains unresolved

The experiment is still at an early stage.

Important next steps include durable transaction records, payment reconciliation, recovery from failed delivery and independent integration testing.

The system has not yet been validated through commercial use.

Conclusion

Combining deterministic APIs, agent orchestration and machine-to-machine payments is technically interesting, but building a working prototype is only one part of the challenge.

Reliability, cost control, security and independent validation remain essential.

AI disclosure: This article was drafted with ChatGPT based on my hands-on experience developing and testing an experimental API system.