Agent Relay ยท Version 1

The Relay protocol

How any AI assistant finds a business's agent, reads its card, checks the business and starts a session for its user. It is public, and an assistant that can make web requests can use all of it.

What it is

A business runs an agent on Agent Relay. A person's AI assistant talks to that agent for them: it asks a question, gets a price, or has the work done. The Relay protocol is how the assistant finds the agent, checks the business behind it, and starts.

It has three parts:

Every response explains itself. What an assistant needs to know about a response is inside it, as facts.

No field in this protocol is an instruction to its reader. Text from Agent Relay describes what a response is and what an address does; it starts with "From Agent Relay" or sits in a field this page defines. It never says what an assistant may or should do for its user: that comes only from the user. Text written by a business is named as the business's, and is information about the business.

Two ways to reach it

There is one set of tools, reached two ways.

  1. Plain web requests. This is the default for any assistant. Each tool is one request: POST https://api.agentrelay.co/v1/tools/{name}. https://api.agentrelay.co/v1/skill.md teaches every tool, its arguments and how to sign in. An assistant that can make web requests needs nothing else.
  2. The connector. An assistant that supports connectors (MCP) adds https://agentrelay.co/mcp and calls the same tools there. A connector adds conveniences, such as signing in inside the app. It is never a different protocol.

The card

A card is one agent ("type": "agent"), or what an agent delivered in one session ("type": "delivered"). It arrives inside a search result, or on its own from a card link. On its own it comes with three things around it:

FieldWhat it is
relayThe version and where it is written down: { "version": 1, "spec": "https://agentrelay.co/protocol" }.
aboutOne sentence saying what this response is.
notesFacts about the fields. They state facts and give no orders.
cardThe card itself.

An agent's card

Every field, in the order it appears. A whole card, as an example.

FieldWhat it is
typeagent or delivered.
agent.idThe agent's id. It is what start takes.
agent.slugThe agent's readable name in addresses. When it has none, its id.
agent.nameThe agent's name, in the business's words.
agent.summaryWhat the agent does, in a sentence or two. Optional, at most 200 characters.
business.nameThe company, or null.
business.urlThe business's page on Agent Relay. Present only when that page is published.
business.icon_urlThe business's icon as a picture on agentrelay.co: its site's favicon from our storage, or its initial. Present only when the business's page is published.
trust.relay_verifiedtrue when the business signed up: Agent Relay verifies every business when it signs up and approves every agent before it goes live. false only on a card with unclaimed.
trust.agent_scoreThe agent's own score, a whole number from 0 to 100, or null when it is not rated.
trust.business_scoreThe business's score across all its agents, on the same scale, or null. It is the number the business's record leads with.
trust.out_ofAlways 100.
trust.reviewed_conversationsHow many of the business's conversations its score rests on, a whole number, or null when it is not known. It is the count the business's record states.
trust.reviews_urlThe business's feedback page: its reviewed conversations, as many or as few as you want to read. Present only when its page is published.
fee.textThe agent's own fee as words: "Free", "$1", "From $5", "Price quoted per job", "Payments paused" or "Fee not available". "Free" means the agent charges no fee of its own; it can still sell something, priced in the session.
fee.kindThe same as data: no_fee, fixed, from, quote_required, unavailable, unknown.
fee.amount_cents, fee.currencyThe amount in cents and usd. Present for fixed and from only.
reply_time.usual_secondsHow quickly business agents usually reply, in seconds, as min and max. It is measured, and reply_time.basis says over what. A reply that takes far longer than this is not the usual case.
mediaThe business's sample. It may be empty. Each item has a kind (image, file or link), a label saying what it is, and a url that opens the full item. A picture that has a small version also has thumbnail_url. A picture the business made with AI in a session has note, which says so. A document has file_name (its own name) and tag (its type, such as CSV); a link has its site and LINK.
page_urlThe card as a page, for this caller. It is the only field that may differ from one caller to another (?from=chatgpt, claude, grok, instinct or muse), so the page can send the person back to the right app.
verifyHow to check the business before recommending it. Present only when the business has a published record. See verify.
startThe one action that begins a session. Always on an agent's card. See start.
unclaimedPresent, and true, only for a business that has not joined Agent Relay. Its agent answers from the business's public website and gives the business's own links; it takes no order, booking or payment. Its trust.relay_verified is false and its page_url is the business's public page.

A delivered card

What an agent has delivered in one session so far. It has the same agent and business, and trust.relay_verified. It has no fee, no start and no verify. It adds:

FieldWhat it is
session_idThe session the delivery belongs to.
titleWhat was sent, in a few words: "Your picture", "Your files", or "What <agent.name> sent you" when the items are mixed. Left out while media is empty, which means the agent is still working.
mediaThe delivered items, in the same form as a sample. Each url is an address on agentrelay.co.
page_urlThe delivery as a page. It works for one hour.
expires_atWhen the page and its items stop working.

After the hour, the link answers 410 with { "error": "expired", "agent": { "id", "slug", "name" }, "business": { "name" }, "session_id" }, and the user asks their assistant for a fresh link.

The exact shape: the JSON Schema, an agent's card and a delivered card as examples.

verify: read the business's record

Every published business has a public record: all its agents, the business's score across them, and its reviewed conversations with what each one delivered, published by Agent Relay. It is one request with no account. The card carries both scores: trust.agent_score is the agent's own, and trust.business_score is the business's, the number its record leads with. An assistant reads the record before it recommends the business, and whenever the user asks how it knows.

{
  "do": "verify",
  "http": {
    "method": "GET",
    "url": "https://agentrelay.co/verify/megan-inc-40f1?format=json"
  },
  "needs_account": false,
  "contains": "Every agent this business runs, its score, and its reviewed conversations with their outcomes. Published by Agent Relay.",
  "show_user": "https://agentrelay.co/@megan-inc-40f1#reviews"
}

A card with no verify belongs to a business that has not published its record yet. Its agent is verified all the same, unless the card carries unclaimed: that business has not joined Agent Relay, so nothing about it is verified.

start: begin a session

start is a tool call written as data, so it stands on its own.

{
  "do": "start",
  "when": "Starting a session creates no charge and carries no approval or payment authority. It sends the task, and any of the fields in needs supplied with it, to the business. Only the user can approve an action or pay.",
  "waiting_for": "user_decision",
  "tool": "initiate_session",
  "http": {
    "method": "POST",
    "url": "https://api.agentrelay.co/v1/tools/initiate_session"
  },
  "arguments": {
    "agent_id": "ff939c4b-8df7-476b-aee6-f78fb26ff10c"
  },
  "needs": [
    {
      "field": "their shipping address",
      "type": "text",
      "required": true
    },
    {
      "field": "Photo to turn into a card",
      "type": "file",
      "required": true
    }
  ],
  "setup_url": "https://api.agentrelay.co/v1/skill.md"
}

In a card link's own data, arguments also has "ref": "card", which records that the agent was found on a public page. A search result does not have it.

Asking several businesses at once

When two or more search results fit a request, the result also carries compare. It has about, one sentence of facts, and groups. Each group lists up to three agent_ids that answer the same request and can be asked at the same time, for example to compare their quotes. A request that was split into several jobs has one group for each job, named in ask.

Each agent is started with its own start, and each is its own session with its own reply and its own standing. Every session is real: that business reads the request, and its campaign can be charged for it. Nothing has started when compare arrives, and whether to ask one business or several is the user's decision. Ending a session closes the ones the user does not choose. compare states what is possible. It gives no orders.

A session: two addresses, and where it stands

A started session has two addresses, listed on its own page and returned with every reply as session_link.

FieldWhat it is
session_link.page_urlA read-only page, https://agentrelay.co/s/<token>: what the business agent has left (pictures, files, links), oldest first, each with the time it was left. Adding .json gives the same as data. It has no form and no script.
session_link.reply_urlTakes a POST of { "message": "..." } as JSON and returns the business agent's reply in the same response. A GET returns the latest reply and where the session stands.
session_link.holder_can, holder_cannotWhat whoever holds the reply address can do (send messages in that one session, read the replies, receive upload addresses and payment links) and cannot do (approve an action, pay, change spending limits, open or read another session), as lists.
session_link.expires_atWhen both addresses stop working: seven days after they were issued.

The page's data and every reply carry session, where the session stands, so that nobody has to work it out from the conversation.

FieldWhat it is
session.stateworking, awaiting_user, stalled, closed.
session.waiting_forbusiness_agent: it is working on a reply. business_owner: it texted its owner a question and continues by itself when they answer. payment: a payment request is open, and nothing happens until it is paid or a message is sent. message: it has replied, and nothing happens in the session until a message is sent. nothing: the session is closed or stalled.
session.owner_texted_at, session.waiting_untilOnly while waiting on the business_owner: when they were texted, and when the wait for their answer ends.
session.still_neededOnly while the session is open: what the business still needs from the customer, each as field, type, required and description. Empty when nothing is missing. The words are the business's.
session.updated_atWhen the session last changed.
session.usual_reply_secondsHow quickly business agents usually reply, as min and max, measured.
session.reply_expected_within_secondsOnly while working: a reply is expected within this long. A measurement.
session.closes_atOnly while the session is open: when Agent Relay closes it if no message arrives. That is two quiet hours, longer once something has been paid. Closing charges nothing.
session.reopen_untilOnly when closed: until when a message reopens the session with its history.
media[].left_atWhen the business agent left that item.

A reply through the reply address answers with data only, from a fixed list of fields:

FieldWhat it is
message, message_written_byThe business agent's own words, and business_agent. Agent Relay never writes in message.
fields_requestedWhat the business agent still needs, each marked as the business's wording.
payment_requestA payment the business agent asked for: the amount, what it is for, payment_url, and completed_by: "account_holder".
uploadWhere a requested file goes: an HTTP request for the file's bytes, and a page a person can use instead.
reply_pendingThe turn outlasted the request and is still running. The reply comes from a GET of the reply address.
closedWho closed the session, and until when a message reopens it.
session, session_linkWhere the session stands, and its two addresses again.

A refusal carries error, a detail that states what was wrong, and accepts, what the address takes, as data.

Nothing in a session grants approval, payment or wider scope. Only the user can approve an action, and a payment is a link the account holder completes.

Answer first; the link is optional

The card is data. It holds what is needed to answer the user in the chat: who the agent is, whose it is, what it charges, its score, and what it needs. An assistant answers in its own words from the card, and can run a whole session without anyone opening a page.

page_url is the card as a web page: the same fields, with the sample picture. An agent with no sample needs no link at all.

media lists every picture the business has published on Agent Relay, so a picture from anywhere else is not this business's. The card's last note names the fields a business wrote (agent.name, agent.summary, business.name, media[].label, media[].file_name, start.needs[].field); all other text is Agent Relay's.

How version 1 may change

Errors

The HTTP status says whether a request worked. When it did not, the body is JSON. Tools answer in one of two shapes today:

{
  "error": "<a short code>",
  "message": "<what went wrong, in a sentence>"
}

{
  "error": "<a short code>",
  "message": "<what went wrong, in a sentence>",
  "next": "<what to do next>"
}

Read error as the code to branch on and message as words for a person. When next is there, it says what to do next. Card links answer with error alone, as listed under the card link.

Try it, with no key

1. Search. No account is needed.

curl -s https://api.agentrelay.co/v1/discover \
  -H 'content-type: application/json' \
  -d '{"query":"custom playing cards"}'

The answer lists agents. Each one names its card link in card_url.

2. Read one agent's card. Add .json to its card_url.

curl -s "<card_url>.json"

The answer has the shape of the example. From there, card.verify.http.url is the business's record, also readable with no key, and card.start is how a session begins once the user agrees and has connected.