AI Gateway
DocsAI Gateway lets a route call supported provider models through one Agentuity project credential. This demo sends the same prompt to selected models in parallel and streams each response as it arrives, so you can compare output shape, latency, and token estimates. Check supported models before choosing app defaults.
Select Models (minimum 2)
Select at least 2 models to compare
Prompt
What is backpropagation and why does it matter for AI?
Reference Code
import { AIGatewayClient } from "@agentuity/aigateway";
const gateway = new AIGatewayClient();
const MODEL = "openai/gpt-5.4-mini";
const models = await gateway.listModels();
const text = await gateway.completeText({
model: MODEL,
messages: [
{
role: "user",
content: "Explain AI agents in one sentence.",
},
],
});
const structured = await gateway.completeStructured<{
summary: string;
category: "agent" | "workflow" | "other";
}>({
model: MODEL,
messages: [
{
role: "user",
content: "Classify this: an AI agent can plan and call tools.",
},
],
response_schema: {
name: "agent_classification",
schema: {
type: "object",
properties: {
summary: { type: "string" },
category: { type: "string", enum: ["agent", "workflow", "other"] },
},
required: ["summary", "category"],
additionalProperties: false,
},
},
});
export const result = {
providers: Object.keys(models),
text: text.text,
structured: structured.data,
};Ready
Output will appear here...