AI SDKDeveloper workbenchStreaming UI

The tiny kitfor buildingAI interfaces.

Forgeon AI SDK gives you clean primitives for chat, streaming, structured output, tools, and gateway-ready AI routes — without turning your app into a bowl of spaghetti.

pnpm add @forgeon/ai

route.ts

live
const result = await streamText({
  route: "support-chat",
  input: message,
})

Assistant preview

Build me a deploy checklist.
Sure. First, verify env vars, build command, runtime port, and rollback target.

Typed object

zod

{

title: "Deployment Guide"

tags: ["ai", "deploy"]

ready: true

}

SDK modules

@forgeon/aiserver primitives
@forgeon/ai/reactclient hooks
@forgeon/ai/toolstyped tools
@forgeon/ai/gatewaygateway routes
AI SDK
streamText()generateObject()useAIChat()defineTool()createAgent()gatewayRoute()streamText()generateObject()useAIChat()defineTool()createAgent()gatewayRoute()streamText()generateObject()useAIChat()defineTool()createAgent()gatewayRoute()streamText()generateObject()useAIChat()defineTool()createAgent()gatewayRoute()

Field manual

The boring AI plumbing is already packed.

Most AI features need the same annoying parts: stream handling, retries, loading states, tool calls, schema validation, and provider routing. The SDK wraps those pieces into primitives you can actually enjoy using.

01

Recipe 01

Streaming chat

Build an assistant UI that feels alive, with messages appearing as the model responds.

useAIChat({ stream: true })

02

Recipe 02

Typed output

Turn unpredictable model replies into validated objects your product can actually trust.

generateObject({ schema })

03

Recipe 03

Tool actions

Let AI call product actions like search, deploy, create, summarize, or query safely.

defineTool({ input, run })

SDK Core

streamText()

useAIChat()

defineTool()

gatewayRoute()

generateObject()

createAgent()

Primitive map

Small functions. Big product behavior.

Treat the SDK like a toolbox, not a black box. Pick the primitive you need, compose it with your product flow, then let Forgeon carry the provider and gateway complexity behind the curtain.

@forgeon/ai

server primitives

@forgeon/ai/react

client hooks

@forgeon/ai/tools

typed tools

@forgeon/ai/gateway

gateway routes

Build sequence

From blank route to AI-native product flow.

01

Install the SDK

ready
02

Create an AI route

ready
03

Stream into UI

ready
04

Add typed output

ready
05

Connect tools

ready
06

Ship with gateway control

ready

app/api/ai/route.ts

import { generateObject } from "@forgeon/ai"
import { z } from "zod"

export async function POST(req: Request) {
  const { prompt } = await req.json()

  const result = await generateObject({
    route: "content-draft",
    schema: z.object({
      title: z.string(),
      summary: z.string(),
      nextSteps: z.array(z.string()),
    }),
    prompt,
  })

  return Response.json(result.object)
}

Typed generation

Stop begging the model to return valid JSON.

Define the shape once, validate the response, and use predictable data in your UI. This is how AI features become product features, not fragile demos held together by hope and vibes.

schema-firstvalidated outputsafe for UIagent-ready

AI SDK

Build the AI layer like it belongs in your product.

Streaming UI, typed output, tool calls, gateway routes, and cleaner primitives for the apps you actually want to ship.

pnpm add @forgeon/ai