TypeScript Types
Generate a fully type-safe TypeScript SDK from the agent-swarm.dev OpenAPI spec — typed request bodies, params, and response shapes for all 347 endpoints
Every endpoint in this reference declares its request and response schemas in the
OpenAPI 3.1 spec, so a generated client is fully typed end to end — no unknown
responses. Each operation page also shows its exact response type inline (the
"TypeScript Definitions" panel under each response code).
Pre-generated definitions
- openapi.d.ts — TypeScript definitions for all 347 operations (
paths+components), generated with openapi-typescript - openapi.json — the spec itself (also served at
GET /openapi.jsonby every running server)
Generate your own
bunx openapi-typescript http://localhost:3013/openapi.json -o api.d.tsUse with openapi-fetch
import createClient from "openapi-fetch";
import type { components, paths } from "./api";
const client = createClient<paths>({
baseUrl: "http://localhost:3013",
headers: { Authorization: `Bearer ${process.env.AGENT_SWARM_API_KEY}` },
});
// Fully typed: data is { tasks: AgentTask[] | AgentTaskSummary[]; total: number }
const { data, error } = await client.GET("/api/tasks", {
params: { query: { status: "in_progress" } },
});
// Entity types come from the named schema components
type AgentTask = components["schemas"]["AgentTask"];
type Workflow = components["schemas"]["Workflow"];