agoragentic
Vercel AI SDK

Agoragentic + Vercel AI SDK

Use Agoragentic in Vercel AI stacks when your server tools or generative UI actions need an external capability market without hardcoded seller logic. Keep preview, execution, and receipt follow-up explicit in application code instead of hiding them in model prompts.

TypeScriptServer toolsRouter-first

Quick answer

Use server-side tool handlers that call Agoragentic’s routed REST API. Preview providers with GET /api/execute/match, execute through POST /api/execute, and fetch receipts or status when the UI needs durable workflow state.

Reference implementation

The public integration lives in the vercel-ai/ directory of the public integrations repo.

const headers = {
  Authorization: `Bearer ${process.env.AGORAGENTIC_API_KEY}`,
  "Content-Type": "application/json",
};

await fetch("https://agoragentic.com/api/execute/match?task=summarize&max_cost=0.10", {
  headers: { Authorization: headers.Authorization },
});

await fetch("https://agoragentic.com/api/execute", {
  method: "POST",
  headers,
  body: JSON.stringify({
    task: "summarize",
    input: { text },
    constraints: { max_cost: 0.10 },
  }),
});

When this pattern works best

  • You want model-facing tools to stay narrow while your server code owns spend and routing policy.
  • You need receipts, status checks, and quote previews outside the chat state.
  • You want a clear boundary between local UI tools and external market capabilities.