How to launch an agentic product
Point a tool at an external endpoint and your own agent becomes the implementation: a single model call, a LangGraph graph, or a multi-agent loop. Gemmein hands it a signed run with a credit ceiling, your agent does the work on its own keys, and you report what it used. Gemmein settles at that, never above the ceiling, and seals the result to the customer, without running or inspecting your agent.
You own the agent. Gemmein owns the customer.
An agentic product has two halves: the intelligence, and the business around it. Gemmein takes the second half, the part that is the same for every product: who the customer is, whether they are allowed to run this, the credits it costs, and where the result is kept. Your agent stays entirely yours. The boundary between the two is a single signed run.
A signed run, a ceiling, a token.
You define a tool on provider external, priced in credits. When a customer starts it, Gemmein reserves the credit ceiling and posts a signed run to your endpoint. Your agent does the work, then reports back to the run's own URLs with a single-use token.
{
"trigger": "run_started",
"run": { "id": "rev_...", "tool": "research-agent",
"params": { "question": "..." },
"units": 0, "reserved": 20, "deadline": "..." },
"person": { "id": "...", "email": "..." },
"complete": {
"url": "https://api.gemmein.com/runs////complete",
"failUrl": "https://api.gemmein.com/runs////fail",
"token": "..."
}
} // Authorization: Bearer <token> (single-use, no session)
POST /runs/<app>/<env>/<id>/complete
{
"units": 14, // what you metered; settled at the tool's rate, never above the ceiling
"text": "…the agent's answer…",
"files": [{ "url": "https://…", "contentType": "application/pdf" }]
}
// or, if it could not finish:
POST /runs/<app>/<env>/<id>/fail { "error": "…" }Gemmein copies the text and files into the customer's sealed files and settles the credits at the units you reported. A failed run returns the hold.
Start a run, watch it finish.
The client side is two calls: start the run, then watch it for progress and the result.
const run = await g.runs.start("research-agent", { question }, { key: jobId });
const done = await g.runs.watch(run.id, { onUpdate: r => show(r.progress) });
// also: g.runs.get(id) · g.runs.list({ since, limit }) · g.runs.cancel(id)The key makes the start idempotent, so a retry does not launch the agent twice.
Least privilege, by construction.
An external tool does not run any Gemmein AI itself, so its key needs no AI capability. You scope the key to the collections the run writes, and nothing more. Your agent authenticates to its own providers with its own keys, which never touch Gemmein.
Give your agent the full task.
Building with Cursor, Claude, Bolt, or Lovable? Paste this so your agent wires the run hand-off correctly.
Read https://docs.gemmein.com/llms.txt and https://docs.gemmein.com/relays. I am building an agentic product and want Gemmein to handle the customer side while my own endpoint runs the agent. Show me how to define an external tool priced in credits, receive the signed run_started hand-off (run id, params, credit ceiling, completion token), do the work on my own keys, and POST the result back to the run's complete URL (units, text, files) or fail it. On the client, use g.runs.start and g.runs.watch. Scope the key only to the collections the run writes.
npx gemmein devRead the getting-started guide Frequently asked questions.
Does Gemmein run or see my agent?
No. A tool on provider external runs on your own pipeline. Gemmein hands off a signed run and receives the result you report. It does not run, inspect, or store your agent's logic, and your agent uses its own provider keys.
What agent frameworks can I use?
Any. The endpoint is just your URL, so it can be a single model call, a LangGraph graph, a multi-agent loop, or any framework. Gemmein does not care what runs behind the URL.
How is an agent run billed?
A credit ceiling is reserved when the run starts. You report the units you metered when you complete it, and Gemmein settles at that, never above the ceiling. A failed run returns the hold.
How does the customer get the result?
You post text and files to the run's complete URL, and Gemmein seals them to the customer's files. The customer never sees your endpoint or your keys.
Related.
Your own compute on the product page · Store your provider key server-side · Charge credits for AI features · Relay docs
See if Gemmein fits your app.
Point your coding agent at docs.gemmein.com/llms.txt and ask it to confirm the fit before it builds.