# Hono routes with type-safe hooks

Define routes with familiar Hono patterns. Agentuity wires them to type-safe React hooks automatically. All cloud services accessible from route context, no infrastructure to manage.

## Routes that deploy with your agents

Define endpoints once and get typed hooks on the frontend. Storage, sandboxes, and streaming are accessible from route context without extra setup.

### Familiar Hono API

No proprietary routing DSL to learn. Use standard Hono patterns and middlewares. Ideal for teams already using Hono or looking for a minimal router.

### Streaming Built In

Use stream() middleware for real-time LLM responses. SSE and WebSocket routes work out of the box. Ephemeral streams flow directly to clients, or persist streams for replay later.

### Zero Infrastructure Setup

Routes deploy automatically with your agents. Storage, sandboxes, and streaming are accessible from route context. Observability and evals work across routes and agents.

## From code to production in one step

Write your endpoint logic, deploy with a single command, and get a production URL with monitoring, logging, and error tracking included. No Docker, no Kubernetes, no infrastructure configuration.

```
import { createRouter } from '@agentuity/runtime';
import assistant from '@agent/assistant';

const router = createRouter();

router.get('/health', (c) => {
  return c.json({ status: 'ok', timestamp: Date.now() });
});

router.post('/chat', assistant.validator(), async (c) => {
  const data = c.req.valid('json');
  const result = await assistant.run(data);
  return c.json(result);
});

export default router;
```

## See it in action

Watch this 1-minute overview to see how to generate production-ready API endpoints, with built-in authentication, using Hono. Deploy APIs in minutes, not weeks.

## Resources

**Routing Overview**  
Define how requests reach your code with HTTP routes, scheduled jobs, and real-time connections using a familiar Hono-based API with full TypeScript support.  
**Creating HTTP Routes**  
Define GET, POST, and other HTTP endpoints with route parameters, query strings, request validation, and streaming responses.  
**When to Use APIs**  
Understand when to use agents versus lightweight routes for your endpoints based on validation needs and complexity.  
**Middleware**  
Add authentication, logging, rate limiting, and other cross-cutting concerns to your routes.  
**Router & Routes API**  
Reference for createRouter(), HTTP methods, route context, and specialized route handlers.

## Frequently Asked Questions

What web framework do Agentuity APIs use?  
Do APIs get automatic type safety?  
Can APIs stream responses?

## Ready to deploy your APIs?

Go from code to production in minutes.
