Turning a freight agent guide into tools: wiring the first 3PL on x402 into an LLM buyer agent A developer at Nettrux, a Fremont, California freight broker and forwarder that says it is the first 3PL on x402, described converting the company's agent guide into a small set of tool definitions for an LLM buyer agent. The design puts a read-only capability check first so the model carries deploy-gate facts (real-money settlement, guest checkout, discovery publishing) for the session, generates quote numbers in code rather than in the model to keep idempotent locks stable, and blocks booking unless a quote's status is active. The authenticated routes require a bearer token the site does not issue, so builders must contact dispatch. Most API docs are written for a developer who reads them once and writes a client. An agent guide has a second reader: the model that will call the routes. That changes what a good integration looks like. You aren't just writing an HTTP client. You're deciding which actions the model is allowed to take, what it must check before each one, and where a person has to sign off. Nettrux https://nettrux.ai is a freight broker and forwarder in Fremont, California, and the first 3PL on x402. Our agent guide https://www.nettrux.ai/agents is short on purpose: it names the routes, the required top-level fields, and the deploy gates, and it points at the OpenAPI for everything else. This post walks through turning that page into a small set of tool definitions for a buyer agent. Nothing here assumes a public, self-serve endpoint. The authenticated routes need a bearer token, and the guide says plainly that the site does not issue one. If you want to build against it, call dispatch and ask. What follows is how we'd shape the agent side once you hold a token. The top of the guide is a list of deploy gates, each an environment variable baked in at build time, where only the exact string true turns it on. Today they read: EDGE X402 DISCOVERY PUBLISHED : false X402 REAL MONEY SETTLEMENT LIVE : false GUEST X402 CHECKOUT ENABLED : false Your first tool should not be "get a quote". It should be a read-only check that fetches the guide or the /.well-known/x402 pointer on nettrux.ai and turns those gates into facts the model carries for the rest of the session. A buyer agent that knows real-money settlement is off will describe a booking response differently than one that assumes every 200 means money moved. A minimal shape: { "name": "read seller capabilities", "description": "Fetch the 3PL's agent guide and discovery pointer. Return the deploy gates and the API host. Read-only.", "parameters": { "type": "object", "properties": {}, "additionalProperties": false } } Put the gate values in the system prompt for the rest of the run. Don't let the model guess them from memory. POST /v1/rates/shop returns ranked options, cheapest first. The guide notes the modes on related rate calls include LTL, AIR, SPOT and FTL. It also says something easy to miss: rate-shopping does not create the quote id that booking needs. That belongs in the tool description, because models love to treat any price as a commitment: { "name": "shop freight rates", "description": "Get ranked freight options for a shipment. Prices are indicative. This does NOT create a bookable quote. Use lock quote before any booking.", "parameters": { "$ref": "openapi rateInput schema" } } Take the parameter schema straight from the OpenAPI at nettrux-edge.fly.dev/openapi.json rather than retyping it. The rate input is strict and rejects unknown fields, which is a feature: the model learns fast that it can't invent a field. Your wrapper should surface that validation error to the model as-is, and your prompt should say that dropping information to make a request validate means stopping and asking the human. POST /v1/quotes takes quoteNumber , validUntil and rateInput . The response gives you data.quote.id , data.quote.lockedTotal and data.quote.status , which is one of active, converted, expired or withdrawn. The lock is idempotent on the quote number you send. Two design choices matter here. First, generate the quote number in your code, not in the model. If the model retries after a timeout, you want the same number to go out so the idempotent lock returns the same quote instead of creating a second one. Second, return lockedTotal and status to the model in plain fields, and have your wrapper refuse to pass a quote id to the next tool unless the status is active. That one check removes a whole class of "booked an expired price" bugs. This is where we think every freight buyer agent should pause. The model has a locked total and a quote id. Before anything is committed, a person who owns the budget should see the lane, the mode, the locked total and the expiry, and say yes. How you build that is up to you: a Slack approval, an email, a button in your own app. What matters is that the commit tool is not callable until approval comes back, and that approval is tied to that specific quote id and total. If the total changes, the approval is void. We'd rather an agent wait an hour for a yes than move freight nobody signed off on. POST /v1/immediate-bookings/commit takes the bearer token and a JSON body of exactly { "quote id": "..." } , with no other fields. The guide says the first call omits the X-PAYMENT header. The OpenAPI summary documents that call as an x402 v1 HTTP 402 challenge, while the published response schema on the operation lists HTTP 200. So your wrapper has to handle both. X-PAYMENT header built by an x402 v1 client from that challenge. The summary describes the retry as verify, then settle, then book. data.booking.money mode and data.settlement network and transaction off the response. Don't infer them. Keep the payment signing out of the model's hands. The model decides "commit this approved quote". Your code builds the payment header, enforces a spend limit per booking and per day, and refuses anything that doesn't match the approved total. GET /v1/immediate-bookings/{booking id} returns a tenant-scoped receipt: the booking plus the settlement projection. Make this the last tool the agent calls on every booking, and have it report to its human from the receipt, not from its own memory of the conversation. That gives your finance team one record to reconcile against. The OpenAPI also lists guest routes: guest session, guest quote locks, a guest cart, guest checkout and a guest x402-settle route. GUEST X402 CHECKOUT ENABLED is false, and the guide says not to call them. Leave them out of your tool list entirely. A tool the model can't see is a tool it can't misuse. We put x402 on the commit route because freight booking is a request that should carry its own payment terms. The seller states the price and terms in a 402, the buyer's client answers in the same HTTP exchange, and the receipt comes back from the same API. Nettrux has settled a real x402 USDC payment on Base in testing. The deploy gate for real-money settlement is still off, and the guide says so, which is exactly why your agent should read gates first. Can I get a token from the site? No. The guide says the site does not issue tokens or describe a signup. Ask dispatch. Should the model sign payments? We'd say no. Let code sign, within limits, after a human approves the specific quote. What if a field I need isn't in the schema? Stop and call dispatch at 1-888-617-3530. Liftgates, residential deliveries and appointment windows matter even when the API can't hold them. Read the full guide at nettrux.ai/agents https://www.nettrux.ai/agents , or start at nettrux.ai https://nettrux.ai . Alex Carney, Nettrux