Agentuity is infrastructure for deploying framework apps, APIs, static sites, background work, and model-backed agents. Current apps start from a framework you already use: keep the framework's routes and server code, add Agentuity services where the app needs them, and use the CLI to run, package, and deploy.
npm create agentuity -- --name my-app --framework nextjs
cd my-app
npx agentuity devThe Default Shape
Your app stays a framework app. A Next.js route reads input, validates it, and calls a model:
import { AIGatewayClient } from '@agentuity/aigateway';
import { NextResponse } from 'next/server';
import { z } from 'zod';
const DEFAULT_MODEL = 'anthropic/claude-opus-4-8';
const ChatRequest = z.object({
message: z.string().min(1),
model: z.string().min(1).default(DEFAULT_MODEL),
});
const gateway = new AIGatewayClient();
export async function POST(request: Request): Promise<NextResponse> {
const body: unknown = await request.json();
const parsed = ChatRequest.safeParse(body);
if (!parsed.success) {
return NextResponse.json({ error: 'Invalid chat request' }, { status: 400 });
}
const result = await gateway.completeText({
model: parsed.data.model,
messages: [{ role: 'user', content: parsed.data.message }],
});
if (!result.hasText) {
return NextResponse.json({ error: 'The model returned no text.' }, { status: 502 });
}
return NextResponse.json({ response: result.text });
}The starter uses @agentuity/aigateway for app-owned model calls. AIGatewayClient reads the Agentuity gateway key or project SDK key from env; the model is normal app input or configuration. agentuity dev runs your framework's dev script and also wires OpenAI, Anthropic, and Groq SDK base URLs for provider SDK compatibility. If you use one of those provider SDKs directly and already have a provider key in .env, the CLI leaves it alone and the call goes straight to the provider.
For AIGatewayClient, the Agentuity project SDK key authenticates model calls across Gateway providers. Pick the model in code, request input, or app configuration; add provider keys only when the route calls a provider SDK directly.
agentuity build and agentuity deploy detect the framework and package the app around its native conventions.
What Agentuity adds
| Area | What you use |
|---|---|
| Local development | agentuity dev wraps your framework's dev script and wires AGENTUITY_SDK_KEY and gateway base URLs |
| Build and deploy | agentuity build and agentuity deploy detect the framework and package its output |
| Project metadata | agentuity.json stores the project id, org id, region, domains, and resource settings |
| Services | standalone clients such as @agentuity/keyvalue, @agentuity/queue, @agentuity/sandbox, and @agentuity/email |
| AI Gateway | model access for OpenAI, Anthropic, Groq, Google, and other providers through your Agentuity project |
| Inspection | sessions, deployment logs, traces, and project resources in the Agentuity Console |
| Operations | deployments, env values, and project settings in the Agentuity Console |
Use service clients in the route, server function, queue handler, or script that owns the work:
import { KeyValueClient } from '@agentuity/keyvalue';
const kv = new KeyValueClient();
await kv.set('sessions', 'user-123', {
updatedAt: new Date().toISOString(),
});The client reads AGENTUITY_SDK_KEY from the environment, so it works in framework routes, server functions, scripts, and workers without extra wiring.
Keep existing app tools where they fit: framework logging, Postgres clients or ORMs, OpenTelemetry collectors, provider SDKs, and framework middleware. Add Agentuity-native services when built-in credentials, managed resources, or shared inspection reduce setup. See Add Agentuity to an existing app for the keep/add matrix.
Where agents fit
Agents are application patterns: model-backed functions that classify, summarize, route, draft, or make a bounded decision. Call them from a framework route, queue consumer, schedule, or script.
See Agents for typed inputs, tool calling, and streaming.
Next Steps
- Installation: install the CLI and sign in
- Quickstart: scaffold a Next.js starter, run it, and deploy
- Project Structure: see exactly what the scaffold adds
- Frameworks: per-framework setup and route patterns
- Services: choose Agentuity service clients for storage, messaging, identity, observability, and execution
- Migration: move older apps into framework routes and direct service clients