---
title: "ChatHN – Chat with Hacker News"
description: "AI chatbot that uses OpenAI Functions and Vercel AI SDK to interact with the Hacker News API with natural language."
url: "https://vercel.com/templates/next.js/chathn"
links:
  repository: "https://github.com/steven-tey/chathn"
  demo: "https://chathn.vercel.app/"
  deploy: "https://vercel.com/new/clone?demo-title=ChatHN+%E2%80%93+Chat+with+Hacker+News&demo-description=AI+chatbot+that+uses+OpenAI+Functions+and+Vercel+AI+SDK+to+interact+with+the+Hacker+News+API+with+natural+language.&demo-url=https%3A%2F%2Fchathn.vercel.app%2F&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F2lviJwxaFNmmqdNynfoUvi%2Fbc4eee4291e05f34c8e3691b3bd5d48d%2FCleanShot_2023-06-25_at_12.47.17.png&project-name=ChatHN+%E2%80%93+Chat+with+Hacker+News&repository-name=chathn&repository-url=https%3A%2F%2Fgithub.com%2Fsteven-tey%2Fchathn&from=templates&skippable-integrations=1&env=OPENAI_API_KEY&envDescription=Get+your+OpenAI+API+key+here%3A&envLink=https%3A%2F%2Fplatform.openai.com%2Faccount%2Fapi-keys"
---

# ChatHN – Chat with Hacker News

AI chatbot that uses OpenAI Functions and Vercel AI SDK to interact with the Hacker News API with natural language.

<a href="https://chathn.vercel.app">
  <img alt="Chat with Hacker News using natural language." src="/app/opengraph-image.png">
  <h1 align="center">ChatHN</h1>
</a>

<p align="center">
  Chat with Hacker News using natural language. Built with OpenAI Functions and Vercel AI SDK. 
</p>

<p align="center">
  <a href="https://news.ycombinator.com/item?id=36480570"><img src="https://img.shields.io/badge/Hacker%20News-210-%23FF6600" alt="Hacker News"></a>
  <a href="https://github.com/steven-tey/chathn/blob/main/LICENSE">
    <img src="https://img.shields.io/github/license/steven-tey/chathn?label=license&logo=github&color=f80&logoColor=fff" alt="License" />
  </a>
  <a href="https://github.com/steven-tey/chathn"><img src="https://img.shields.io/github/stars/steven-tey/chathn?style=social" alt="ChatHN's GitHub repo"></a>
</p>

<p align="center">
  <a href="#introduction"><strong>Introduction</strong></a> ·
  <a href="#deploy-your-own"><strong>Deploy Your Own</strong></a> ·
  <a href="#setting-up-locally"><strong>Setting Up Locally</strong></a> ·
  <a href="#tech-stack"><strong>Tech Stack</strong></a> ·
  <a href="#contributing"><strong>Contributing</strong></a> ·
  <a href="#license"><strong>License</strong></a>
</p>
<br/>

## Introduction

ChatHN is an open-source AI chatbot that uses [OpenAI Functions](https://platform.openai.com/docs/guides/gpt/function-calling) and the [Vercel AI SDK](https://sdk.vercel.ai/docs) to interact with the [Hacker News API](https://github.com/HackerNews/API) with natural language.

https://github.com/steven-tey/chathn/assets/28986134/9c0ad554-f4e5-4e98-8771-5999ddf79235

## Deploy your own

You can deploy your own version of ChatHN with 1-click:

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?demo-title=ChatHN%20%E2%80%93%20Chat%20with%20Hacker%20News&demo-description=AI%20chatbot%20that%20uses%20OpenAI%20Functions%20and%20Vercel%20AI%20SDK%20to%20interact%20with%20the%20Hacker%20News%20API%20with%20natural%20language.&demo-url=https%3A%2F%2Fchathn.vercel.app%2F&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F2lviJwxaFNmmqdNynfoUvi%2Fbc4eee4291e05f34c8e3691b3bd5d48d%2FCleanShot_2023-06-25_at_12.47.17.png&project-name=ChatHN%20%E2%80%93%20Chat%20with%20Hacker%20News&repository-name=chathn&repository-url=https%3A%2F%2Fgithub.com%2Fsteven-tey%2Fchathn&from=templates&skippable-integrations=1&env=OPENAI_API_KEY&envDescription=Get%20your%20OpenAI%20API%20key%20here%3A&envLink=https%3A%2F%2Fplatform.openai.com%2Faccount%2Fapi-keys)

## Setting Up Locally

To set up ChatHN locally, you'll need to clone the repository and set up the following environment variables:

- `OPENAI_API_KEY` – your OpenAI API key (you can get one [here](https://platform.openai.com/account/api-keys))

## Tech Stack

ChatH is built on the following stack:

- [Next.js](https://nextjs.org/) – framework
- [OpenAI Functions](https://platform.openai.com/docs/guides/gpt/function-calling) - AI completions
- [Vercel AI SDK](https://sdk.vercel.ai/docs) – AI streaming library
- [Vercel](https://vercel.com) – deployments
- [TailwindCSS](https://tailwindcss.com/) – styles

## Contributing

Here's how you can contribute:

- [Open an issue](https://github.com/steven-tey/chathn/issues) if you believe you've encountered a bug.
- Make a [pull request](https://github.com/steven-tey/chathn/pull) to add new features/make quality-of-life improvements/fix bugs.

## Author

- Steven Tey ([@steventey](https://twitter.com/steventey))

## License

Licensed under the [MIT license](https://github.com/steven-tey/chathn/blob/main/LICENSE.md).

## Related Templates

### [ChatGPT Plugin Starter: WeatherGPT](https://vercel.com/templates/next.js/weathergpt)

The ultimate ChatGPT Plugin starter template. WeatherGPT is a ChatGPT Plugin to get the weather of any given location.

### [Chatbot](https://vercel.com/templates/next.js/chatbot)

A full-featured, hackable Next.js AI chatbot built by Vercel

### [Novel – AI-powered Notion-style editor](https://vercel.com/templates/next.js/novel)

A Notion-style WYSYWIG editor with AI-powered autocompletions, built with Tiptap, OpenAI, and Vercel AI SDK.

---

## Additional documentation

The [Vercel Knowledge Base](https://vercel.com/kb) contains guides and answers to common questions about Vercel, including deployment, framework configuration, domains, caching, and troubleshooting.
