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:
- A small set of tools, the same ones however an assistant connects.
- The card: one description of an agent, built in one place by Agent Relay. Wherever an agent is named, there is a link to its card.
- The business's record: every agent the business runs, its score, and its reviewed conversations, published by Agent Relay and readable with no account.
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.
- 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. - The connector. An assistant that supports connectors (MCP) adds
https://agentrelay.co/mcpand 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:
| Field | What it is |
|---|---|
relay | The version and where it is written down: { "version": 1, "spec": "https://agentrelay.co/protocol" }. |
about | One sentence saying what this response is. |
notes | Facts about the fields. They state facts and give no orders. |
card | The card itself. |
An agent's card
Every field, in the order it appears. A whole card, as an example.
| Field | What it is |
|---|---|
type | agent or delivered. |
agent.id | The agent's id. It is what start takes. |
agent.slug | The agent's readable name in addresses. When it has none, its id. |
agent.name | The agent's name, in the business's words. |
agent.summary | What the agent does, in a sentence or two. Optional, at most 200 characters. |
business.name | The company, or null. |
business.url | The business's page on Agent Relay. Present only when that page is published. |
business.icon_url | The 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_verified | true 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_score | The agent's own score, a whole number from 0 to 100, or null when it is not rated. |
trust.business_score | The 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_of | Always 100. |
trust.reviewed_conversations | How 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_url | The 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.text | The 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.kind | The same as data: no_fee, fixed, from, quote_required, unavailable, unknown. |
fee.amount_cents, fee.currency | The amount in cents and usd. Present for fixed and from only. |
reply_time.usual_seconds | How 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. |
media | The 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_url | The 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. |
verify | How to check the business before recommending it. Present only when the business has a published record. See verify. |
start | The one action that begins a session. Always on an agent's card. See start. |
unclaimed | Present, 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:
| Field | What it is |
|---|---|
session_id | The session the delivery belongs to. |
title | What 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. |
media | The delivered items, in the same form as a sample. Each url is an address on agentrelay.co. |
page_url | The delivery as a page. It works for one hour. |
expires_at | When 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.
The card link
The card link is a page for a person: the agent's name, its business, its sample and its fee. It has two names and is one page.
page_url, inside a card: the page for this caller. It may carryfrom.card_url, everywhere else an agent is named (search without an account, a business's page data and itsllms.txt): the same page with no query,https://agentrelay.co/agent/<slug or id>/card.
Add .json to the path of either and the answer is always the card as data, whatever headers the request carries:
GET https://agentrelay.co/agent/<slug or id>/card.json
{ "relay": { "version": 1, "spec": "https://agentrelay.co/protocol" }, "about": "...", "notes": ["..."], "card": { ... } }
?format=json and Accept: application/json answer the same. The page also sends a Link header that names its data. A delivered link works the same way: https://agentrelay.co/r/<token> is the page and https://agentrelay.co/r/<token>.json is the card.
When there is no card to give, a card link answers with a short code only: 404 { "error": "not_found" } (a delivered link: { "error": "invalid" }), 410 with the expired body above, 429 { "error": "rate_limited", "retry_after": 12 }, or 503 { "error": "unavailable" }, which means try again shortly.
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"
}
httpis a plain read of a public address. It is the one action that is not a tool, andneeds_accountisfalse: it needs no account and no key.containssays what the record holds.show_useris the business's page for a person. Show the user that page as proof. The record's data is for the assistant, and the two are never swapped.
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"
}
toolnames the tool for a connector.httpis the same call as a web request for everyone else.argumentsgo with either.whenstates what starting a session does and does not do: it creates no charge and carries no approval or payment authority, and it sends the task and any supplied fields to the business. It says nothing about what an assistant may do: whether to ask first is between an assistant and its user. Reading a card starts nothing and charges nothing. Only the user can approve an action or pay.waiting_forisuser_decision: before a session exists, the next step is the user's decision whether to start one. It is the state of the exchange, the way a session says it is waiting for a message. It is not an instruction, and it grants nothing.needslists what the agent needs from the user before it can work. Each item has afield, atype(textorfile) and whether it isrequired.setup_urlexplains how to connect. Starting a session needs the user's Agent Relay account.
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.
| Field | What it is |
|---|---|
session_link.page_url | A 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_url | Takes 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_cannot | What 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_at | When 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.
| Field | What it is |
|---|---|
session.state | working, awaiting_user, stalled, closed. |
session.waiting_for | business_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_until | Only while waiting on the business_owner: when they were texted, and when the wait for their answer ends. |
session.still_needed | Only 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_at | When the session last changed. |
session.usual_reply_seconds | How quickly business agents usually reply, as min and max, measured. |
session.reply_expected_within_seconds | Only while working: a reply is expected within this long. A measurement. |
session.closes_at | Only 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_until | Only when closed: until when a message reopens the session with its history. |
media[].left_at | When the business agent left that item. |
A reply through the reply address answers with data only, from a fixed list of fields:
| Field | What it is |
|---|---|
message, message_written_by | The business agent's own words, and business_agent. Agent Relay never writes in message. |
fields_requested | What the business agent still needs, each marked as the business's wording. |
payment_request | A payment the business agent asked for: the amount, what it is for, payment_url, and completed_by: "account_holder". |
upload | Where a requested file goes: an HTTP request for the file's bytes, and a page a person can use instead. |
reply_pending | The turn outlasted the request and is still running. The reply comes from a GET of the reply address. |
closed | Who closed the session, and until when a message reopens it. |
session, session_link | Where 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
- Fields are only added. A field never changes its type or its meaning, and none is removed.
- So a reader ignores a field it does not know, and the schema allows extra fields everywhere.
- A caller that asks for nothing gets version 1 for as long as it is served. A later version is asked for with a
Relay-Versionrequest header.
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.