Blazing Agents
Ship production agents without building the infrastructure behind them.
Blazing Agents runs the production infrastructure for your AI agents, so you can ship agent features without building a backend for them.
You write the agent logic: instructions, the model it uses, and the tools it can call. Blazing Agents runs everything around it. Conversations are stored, files survive between sessions, background tasks keep running after your request returns, and every turn's token usage is tracked. You call it from your backend with an SDK or plain HTTP. Read why teams use Blazing Agents for the longer case.
See it work
A typical integration is one chat route on your backend. Your frontend posts the user's message to it, and the route streams the agent's reply back. Set BLAZING_AGENTS_API_KEY from your dashboard and OPENROUTER_API_KEY from OpenRouter.
Run once: create the agent
Save a model provider and an agent that uses it. Run this script one time and keep the printed agent ID. Agent names are unique, so a second run fails; reuse the agent you already have.
import { BlazingAgents } from "@blazingagents/sdk";
const client = new BlazingAgents({
apiKey: process.env.BLAZING_AGENTS_API_KEY!,
});
const provider = await client.providers.create({
name: "OpenRouter",
providerType: "openrouter",
baseUrl: null,
apiKey: process.env.OPENROUTER_API_KEY!,
});
const agent = await client.agents.create({
name: "Support agent",
instructions: "Answer clearly and briefly.",
providerId: provider.id,
model: "openai/gpt-6-luna",
});
console.log(`BLAZING_AGENTS_AGENT_ID=${agent.id}`);Add the chat route
Set BLAZING_AGENTS_AGENT_ID to the printed ID. The route starts a new conversation when the request has no sessionId, and continues that conversation when it does.
import { BlazingAgents, type UIMessage } from "@blazingagents/sdk";
const client = new BlazingAgents({
apiKey: process.env.BLAZING_AGENTS_API_KEY!,
});
export async function POST(request: Request): Promise<Response> {
const { message, sessionId } = await request.json();
const result = await client.chat({
agentId: process.env.BLAZING_AGENTS_AGENT_ID!,
message,
sessionId,
});
return result.toResponse();
}On the frontend, useChat with BlazingAgentsChatTransport renders the streamed reply and sends the session ID back on the next message; see Build a chatbot. Keep your API key on the backend, and before you continue a session, check that it belongs to the signed-in user. Connect Blazing Agents to your app covers that check.
What you can build
A chat backend
Stream replies to your app and pick up any conversation where it left off.
Agents with files and a shell
Give an agent a file system that survives between sessions, and let it run commands in it.
Background and scheduled work
Run agent work outside a chat, once or on a schedule, and check the result later.
Tools and MCP
Let an agent call built-in tools or your own MCP servers, with human approval where you need it.
Bill your users
Charge your own customers for the model tokens they use, through your Polar or Dodo account.
Start here
New to Blazing Agents:
- Set up your API key and install an SDK.
- Run your first agent.
- Browse complete apps in the examples repository.
Find a task
| I want to | Go to |
|---|---|
| Save a provider and choose a model | Providers and models |
| Stream chat through my backend | Chat endpoint pattern |
| Build a chat UI with stop, edit, and regenerate | Build a chatbot |
| Get structured JSON back | Structured output |
| Teach an agent a reusable skill | Skills |
| Connect an MCP server | MCP tools |
| Approve tool calls before they run | Tool approvals |
| Run a background task | Task runs |
| Run a task on a schedule | Schedules |
| Put an agent in Slack or Telegram | Slack and Telegram |
| Track usage and set monthly limits | Usage and quotas |
Choose an interface
| Interface | Use it when |
|---|---|
| TypeScript SDK | Your backend runs TypeScript and you want AI SDK streaming. |
| Python SDK | Your backend runs Python, sync or async. |
| REST API | You work in another language or want direct HTTP control. |
| CLI | You want to chat with agents or script one-off runs from a terminal. |