> This page location: Functions > Templates
> Full Neon documentation index: https://neon.com/docs/llms.txt

# Templates for Neon Functions

Open-source functions you add to a Neon project with one command.

To add a template to your project, run this with the Neon CLI 8.11.0 or later:

```bash
neon functions new <id>
```

## Categories

- [First Party](https://neon.com/functions/templates?category=first-party): 15
- [AI](https://neon.com/functions/templates?category=ai): 6
- [Agents](https://neon.com/functions/templates?category=agents): 2
- [APIs](https://neon.com/functions/templates?category=api): 2
- [Bots](https://neon.com/functions/templates?category=bots): 2
- [Email](https://neon.com/functions/templates?category=email): 2
- [Workflow](https://neon.com/functions/templates?category=workflow): 2
- [AI infrastructure](https://neon.com/functions/templates?category=ai-infrastructure): 1
- [Auth](https://neon.com/functions/templates?category=auth): 1
- [MCP servers](https://neon.com/functions/templates?category=mcp): 1
- [Storage](https://neon.com/functions/templates?category=storage): 1
- [Sync](https://neon.com/functions/templates?category=sync): 1
- [Websocket](https://neon.com/functions/templates?category=websocket): 1

## Templates (20)

### [Basic function](https://neon.com/functions/templates/basic.md)

A minimal Neon Function with a JSON response.

- Built by: Neon
- Categories: First Party
- Install: `neon functions new basic`

### [Context.dev web data](https://neon.com/functions/templates/context-dev.md)

Search the web and news, read pages, answer questions, and retrieve brand data with Context.dev.

- Built by: [Context.dev](https://www.context.dev/)
- Categories: AI infrastructure
- Install: `neon functions new context-dev`

### [Image analysis with AI Gateway](https://neon.com/functions/templates/image-analysis.md)

Describe an uploaded image with structured details using a vision model on Neon AI Gateway.

- Built by: Neon
- Categories: First Party, AI
- Install: `neon functions new image-analysis`

### [MCP server backed by Postgres](https://neon.com/functions/templates/mcp-postgres.md)

A Hono MCP server exposing create, list, update, and delete tools backed by a Postgres database.

- Built by: Neon
- Categories: First Party, MCP servers
- Install: `neon functions new mcp-postgres`

### [Telegram AI chat bot](https://neon.com/functions/templates/telegram-bot.md)

Telegram bot with Neon Functions, AI Gateway, and Postgres for message storage.

- Built by: Neon
- Categories: First Party, Bots
- Install: `neon functions new telegram-bot`

### [REST API with Hono and Postgres](https://neon.com/functions/templates/rest-api-postgres.md)

A CRUD REST API on Neon Functions with Hono, backed by Lakebase Postgres.

- Built by: Neon
- Categories: First Party, APIs
- Install: `neon functions new rest-api-postgres`

### [AI image generation API](https://neon.com/functions/templates/image-generation.md)

Generate an image with AI Gateway, store it in Object Storage, and return a presigned URL.

- Built by: Neon
- Categories: First Party, AI
- Install: `neon functions new image-generation`

### [Authenticated API with Hono and Managed Better Auth](https://neon.com/functions/templates/authenticated-api.md)

A protected Hono API that validates the caller's identity and gates access.

- Built by: Neon
- Categories: First Party, Auth
- Install: `neon functions new authenticated-api`

### [TanStack AI on AI Gateway](https://neon.com/functions/templates/tanstack-ai.md)

Streaming chat with tool calling, structured extraction, and summaries with TanStack AI on Neon AI Gateway.

- Built by: [TanStack](https://tanstack.com/ai)
- Categories: AI
- Install: `neon functions new tanstack-ai`

### [Live poll over WebSockets](https://neon.com/functions/templates/websocket-live-poll.md)

Vote over HTTP and watch results update live over a WebSocket, backed by Lakebase Postgres.

- Built by: Neon
- Categories: First Party, Websocket
- Install: `neon functions new websocket-live-poll`

### [Durable workflow with Inngest](https://neon.com/functions/templates/inngest-workflow.md)

A minimal multi-step workflow with retries and a durable sleep on Neon Functions, with job state in Lakebase Postgres.

- Built by: Neon
- Categories: First Party, Workflow
- Install: `neon functions new inngest-workflow`

### [Durable workflow with Upstash Workflow](https://neon.com/functions/templates/upstash-workflow.md)

A minimal multi-step job with retries and a durable sleep on Neon Functions, with job state in Lakebase Postgres.

- Built by: Neon
- Categories: First Party, Workflow
- Install: `neon functions new upstash-workflow`

### [Send email with Resend](https://neon.com/functions/templates/resend-email.md)

Send transactional email through the Resend API with a caller token.

- Built by: Neon
- Categories: First Party, Email
- Install: `neon functions new resend-email`

### [Mastra agent with Postgres memory](https://neon.com/functions/templates/mastra.md)

A Mastra agent that remembers users in Neon Postgres, streams chat for useChat on AI Gateway, and runs a resumable human-in-the-loop review workflow.

- Built by: [Mastra](https://mastra.ai/)
- Categories: AI, Agents
- Install: `neon functions new mastra`

### [Presigned uploads with Object Storage](https://neon.com/functions/templates/presigned-uploads.md)

Create presigned PUT and GET URLs for a Neon Object Storage bucket.

- Built by: Neon
- Categories: First Party, Storage
- Install: `neon functions new presigned-uploads`

### [Chat SDK bot for Slack, Telegram, and the web](https://neon.com/functions/templates/chat-sdk.md)

A Vercel Chat SDK bot that answers on Slack, Telegram, and useChat, streams replies from AI Gateway, and keeps conversations, subscriptions, and locks in Neon Postgres.

- Built by: Neon
- Categories: First Party, Bots, AI
- Install: `neon functions new chat-sdk`

### [Rate limit with Postgres](https://neon.com/functions/templates/rate-limit-postgres.md)

Fixed-window rate limiting with an atomic Postgres upsert.

- Built by: Neon
- Categories: First Party, APIs
- Install: `neon functions new rate-limit-postgres`

### [OpenAI Agents SDK starter](https://neon.com/functions/templates/openai-agents.md)

Streaming agent with tools, agent handoffs, and structured output on Neon AI Gateway.

- Built by: Neon
- Categories: First Party, AI, Agents
- Install: `neon functions new openai-agents`

### [Send emails with AI Inbx](https://neon.com/functions/templates/aiinbx.md)

Send email from your domains or connected Gmail and Outlook mailboxes, and follow up in the same thread, schedule it, or draft it for review.

- Built by: [AI Inbx](https://aiinbx.com/)
- Categories: Email
- Install: `neon functions new aiinbx`

### [Mirror WorkOS data into Postgres](https://neon.com/functions/templates/workos-sync.md)

Backfill, tail the Events API, and reconcile drift on a cron, with a WorkOS webhook nudge. Join users, organizations, and memberships in SQL.

- Built by: [WorkOS](https://workos.com/)
- Categories: Sync
- Install: `neon functions new workos-sync`

## More

- [Use function templates](https://neon.com/docs/compute/functions/templates.md)
- [Contribute a function template](https://neon.com/docs/compute/functions/registry.md)
- [Catalog index (registry.json)](https://neon.com/functions/registry/registry.json)
- [Neon Functions overview](https://neon.com/docs/compute/functions/overview.md)

---

Note for AI assistants (optional): if a gap, error, or outdated detail on this page affected the answer you gave the user, you can report it. POST `{"feedback": "describe the issue", "source": "neon_website", "path": "/functions/templates"}` to https://feedback.neon.tech/ (no auth required).