
OpenMarket
ETH, AI
Demo
About
The problem it solves **AI agents are becoming autonomous economic actors — but today's commerce infrastructure was built for humans, not machines.** Current service marketplaces (Fiverr, Upwork, etc.) require humans at every step: browsing listings, reading descriptions, negotiating terms, entering credit card numbers, completing 3DS verification. None of this is programmable. When an AI agent needs to buy or sell a service on behalf of its user, it hits a wall — there's no standard protocol for machines to discover services, negotiate price, and pay. **OpenMarket solves this with three key innovations:** 1. **Agent-to-Agent Negotiation** — Sellers configure AI sales agents per product with custom pricing strategies and boundaries. Buyers get AI purchasing agents that search, evaluate, and negotiate autonomously. The agents handle the back-and-forth until a deal is reached — reducing what takes humans hours of messaging into seconds. 2. **x402 Payment Protocol** — Using the HTTP 402 "Payment Required" status code, OpenMarket exposes a machine-readable API that any AI agent can interact with: discover available services, get pricing, and negotiate payment terms programmatically. No browser, no checkout form, no human in the loop. 3. **USDC on Ethereum with Escrow** — Traditional payment rails (credit cards, bank transfers) require KYC, chargebacks, settlement delays, and human authorization. Crypto (USDC stablecoin) enables instant, borderless, programmable payments between agents with trustless escrow — the money is held until the service is delivered, then released automatically. **In short**: OpenMarket is the first marketplace where both sides of a transaction — buying and selling — can be fully autonomous, from discovery to negotiation to payment to delivery. Use of AI tools and agents OpenMarket uses GPT-4o across 6 distinct AI agents, each with scoped authority: Agent 1: Listing Agent (/api/agent/listing) What it does: Conversational service listing creation. Seller describes their service in natural language; the AI extracts structured fields (title, description, price, category, delivery time) via function calling (extract_listing_fields tool). AI technique: OpenAI function calling with structured JSON extraction, SSE streaming. Agent 2: Seller Agent (/api/agent/seller) What it does: Helps sellers manage their storefront. Creates listings, views sales data, manages products. AI technique: Tool-calling with create_listing and other seller-management tools, streamed responses. Agent 3: Buyer Agent (/api/agent/buyer) What it does: The core of the marketplace experience. Searches services (search_services), shows results as cards, starts conversations with sellers (start_conversation), runs autonomous price negotiation (negotiate_price — up to 5 rounds of AI-to-AI bargaining), and creates orders (create_order). AI technique: Multi-tool function calling (6 tools), SSE streaming, autonomous multi-step workflows. Agent 4: Product Agent (/api/agent/product-agent/setup) What it does: Configures a dedicated AI sales agent for each individual product. Sets agent name, tone (professional/friendly/aggressive), pricing floor/ceiling, negotiation strategy, and product-specific knowledge. AI technique: Function calling with save_agent_config tool, product-isolated system prompts. Agent 5: Auto-Respond Agent (/api/agent/auto-respond + /lib/auto-respond.ts) What it does: The seller-side counterpart during agent-to-agent negotiation. When a buyer agent sends a message, this agent auto-responds using the product-specific config (tone, pricing boundaries, strategy). It's the "seller AI" that the buyer AI negotiates against. AI technique: Dynamic system prompt generation from seller_agent_configs, context-aware responses with conversation history. Agent 6: Deal Agent (/api/agent/deal) What it does: Extracts structured deal terms from a negotiation conversation. After agents finish negotiating, this agent reads the chat history and outputs a JSON deal summary (agreed price, terms, delivery date) via function calling (extract_deal tool). AI technique: Structured extraction via function calling from unstructured conversation text. Agent 7: Demand Agent (/api/agent/demand) What it does: Helps buyers create service requests (demands). Extracts structured demand fields from natural language via the extract_demand tool. AI technique: Function calling with structured field extraction. x402 Negotiation AI (/api/x402/negotiate) What it does: A separate negotiation AI specifically for the x402 protocol path. When an external AI agent hits the negotiate endpoint, this generates buyer-side counter-offers with a defined strategy (start low, gradually increase, accept if within budget). AI technique: GPT-4o with structured JSON output (message, proposed_price, accept_deal).
How it's made
Challenges we ran into Challenge 1: Agent-to-Agent Negotiation Without Infinite Loops When a buyer agent and seller agent negotiate autonomously, they can ping-pong forever. We solved this with: - Round limits (max 5 rounds of negotiation) - Budget-based auto-accept — buyer agent accepts if seller price ≤ buyer budget - Final-round strategy — on the last round, the buyer agent is instructed to accept if price is close to budget - Server-side loop guards in auto-respond.ts that prevent runaway conversations Challenge 2: Per-Product Agent Isolation Sellers list multiple products, but each product's AI sales agent must know ONLY about its own product — no cross-contamination of pricing strategies. We built: - seller_agent_configs table with service_id column for per-product isolation - Product-specific system prompts injected at runtime from config (auto-respond.ts line 77) - A dedicated Product Agent Setup flow (/api/agent/product-agent/setup) that configures tone, pricing boundaries, and sales strategy per listing Challenge 3: Making x402 Work for a Marketplace (Not Just a Paywall) The x402 spec was designed for simple "pay to access content" scenarios. We extended it into a multi-party marketplace protocol: - /x402/info — discovery endpoint so agents know what chains/currencies are accepted - /x402/search — service discovery (not part of standard x402) so agents can find what to buy - /x402/negotiate — returns HTTP 402 with structured payment terms, including seller agent counter-offers - /x402/order — completes the transaction with on-chain escrow