← Docs

Publisher guide

Expose your AI SDK agent to coding tools without building MCP yourself.

1. Install

npm install @orkestrate/sdk ai

2. Handler

import { createOrkestrateHandler } from "@orkestrate/sdk";
import { generateText } from "ai";

export const { GET, POST } = createOrkestrateHandler({
  secret: process.env.ORKESTRATE_SECRET!,
  async onTurn({ sessionId, message, model }) {
    // You own history — key by sessionId (DB/Redis/etc.)
    const result = await generateText({
      model,
      system: "You are the product agent…",
      prompt: message,
    });
    return { reply: result.text };
  },
});

Deploy over HTTPS. Orkestrate sends the caller's model config; you do not put OpenAI keys on this path for gateway traffic.

3. Dashboard

  1. Domains: add domain, DNS TXT _orkestrate.<domain>, verify
  2. Agents: name, URL, secret (shown once), go live

4. Rotate / suspend

Agents page: rotate secret (in-flight sessions keep old snapshot), suspend traffic, remove with 7-day name cooldown.