API Overview
Complete reference for the UI Inspect tRPC API with all available endpoints.
UI Inspect uses tRPC for its API layer, providing type-safe communication between all components. The API is available at http://localhost:3000/api/trpc.
Base URL
http://localhost:3000/api/trpcFor self-hosted instances, replace with your server URL.
Authentication
All protected endpoints require either:
- Session auth — Cookie-based sessions from the web app
- API key auth — Bearer token in the
Authorizationheader
# API key authentication
curl -H "Authorization: Bearer uii_your-api-key" \
"http://localhost:3000/api/trpc/project.list"See Authentication for details.
Calling tRPC endpoints
From the CLI / Node.js
import type { AppRouter } from "@ui-inspect/api";
import { createTRPCClient, httpBatchLink } from "@trpc/client";
const client = createTRPCClient<AppRouter>({
links: [
httpBatchLink({
url: "http://localhost:3000/api/trpc",
headers: {
Authorization: `Bearer ${process.env.UI_INSPECT_TOKEN}`,
},
}),
],
});
// Query
const projects = await client.project.list.query();
// Mutation
const build = await client.build.create.mutate({
projectId: "uuid",
branch: "main",
});Via HTTP
tRPC endpoints are accessible as HTTP endpoints:
# Queries use GET
GET /api/trpc/project.list
# Mutations use POST
POST /api/trpc/build.create
Content-Type: application/json
{"projectId": "uuid", "branch": "main"}tRPC uses batch requests by default. The HTTP transport URL format is /api/trpc/<procedure-name>.
API routers
Projects
Create, list, update, and delete projects
Builds
Manage visual testing build runs
Comparisons
Visual comparison CRUD and analysis
Baselines
Baseline image management and approval
Diff Analysis
Run visual diff analysis and generate fixes
Performance
Core Web Vitals tracking and performance budgets
Reviews & Sharing
Review comments, share links, activity log, and reports
Integrations
GitHub, Figma, and other integrations
Team
Workspace and team member management
Webhooks
Webhook configuration and testing
Rate limits
Self-hosted instances have no rate limits by default. The hosted version applies:
| Tier | Requests/minute |
|---|---|
| Free | 60 |
| Pro | 600 |
| Enterprise | Unlimited |