Keys belong on the server.
Never embed your partner key in browser code, mobile bundles, or a public repository. The browser SDK only prepares wallet permissions.
YOUR APP. THEIR MERRYMAN.
Create agents. Set their limits. Start a conversation.
One API, with the entire setup inside your app.
// Your interface. Their agent. const agent = await merrymen( "/agents", { external_user_id: "usr_123", name: "Robin" });
{
"id": "pa_…",
"status": "pending_authorization"
}The owner signs. Merrymen runs the worker.
01 / YOUR WORKSPACE
Give each app its own key. User wallets stay in their control.
02 / FROM ZERO TO FIRST CONVERSATION
Your backend holds the key. Your user signs the permissions. We run the agent.
Save your key as MERRYMEN_API_KEY on your server. Create a connection for a user who is signed in to your app. A pending_authorization response means they still need to approve wallet permissions.
// Your backend only. Never put this key in browser code.
const API = "https://ai.merrymen.dev/partner/v1";
async function merrymen(path, body) {
const response = await fetch(API + path, {
method: body === undefined ? "GET" : "POST",
headers: {
Authorization: `Bearer ${process.env.MERRYMEN_API_KEY}`,
"Content-Type": "application/json",
},
...(body === undefined ? {} : { body: JSON.stringify(body) }),
});
const data = await response.json();
if (!response.ok) throw new Error(data.error?.message || "API error");
return data;
}
// Get this ID from YOUR authenticated session.
const agent = await merrymen("/agents", {
external_user_id: currentUser.id,
name: "Robin",
});03 / THE SURFACE AREA
https://ai.merrymen.dev/partner/v1/agentsCreate a user's agent connection+Create a user's agent connection. Requires write:agents and your backend’s Authorization: Bearer <key> header.
/agents/{id}/challengeRequest wallet authorization+Request wallet authorization. Requires write:agents and your backend’s Authorization: Bearer <key> header.
/agents/{id}/activateInstall permissions & start the worker+Install permissions & start the worker. Requires write:agents and your backend’s Authorization: Bearer <key> header.
/agents/{id}Read actual worker status+Read actual worker status. Requires read:agents and your backend’s Authorization: Bearer <key> header.
/agents/{id}/messagesSend a message to the agent+Send a message to the agent. Requires chat:agents and your backend’s Authorization: Bearer <key> header.
/agents/{id}/messagesRead conversation history+Read conversation history. Requires chat:agents and your backend’s Authorization: Bearer <key> header.
/agents/{id}/connectionDisconnect your app+Disconnect your app. Requires write:agents and your backend’s Authorization: Bearer <key> header.
04 / BEFORE YOU SHIP
Never embed your partner key in browser code, mobile bundles, or a public repository. The browser SDK only prepares wallet permissions.
Derive user IDs from your own authenticated sessions. Every agent needs its owner’s signature before your app can use its private context.
Chat proposals are not executed automatically. Agent workers follow their signed permissions and configured strategy. No provider available? Chat says so.
Replace a key to keep the same app ID. Update your backend, then revoke the old key. Disconnecting an app does not stop the underlying agent.