1,958
stars
176
commits
TypeScript
primary language
Jul 31, 2026
updated
ChatKit is a batteries-included framework for building high-quality, AI-powered chat experiences. It’s designed for developers who want to add advanced conversational intelligence to their apps fast—with minimal setup and no reinventing the wheel. ChatKit delivers a complete, production-ready chat interface out of the box.
Key features include:
Simply drop the ChatKit component into your app, configure a few options, and you're good to go.
ChatKit is a framework-agnostic, drop-in chat solution. You don’t need to build custom UIs, manage low-level chat state, or patch together various features yourself. Just add the ChatKit component, give it a client token, and customize the chat experience as needed, no extra work needed.
Generate a client token on your server.
from fastapi import FastAPI
from pydantic import BaseModel
from openai import OpenAI
import os
app = FastAPI()
openai = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
@app.post("/api/chatkit/session")
def create_chatkit_session():
session = openai.chatkit.sessions.create({
# ...
})
return { client_secret: session.client_secret }
Install the React bindings
npm install @openai/chatkit-react
Add the ChatKit JS script to your page
<script
src="https://cdn.platform.openai.com/deployments/chatkit/chatkit.js"
async
></script>
Render ChatKit
import { ChatKit, useChatKit } from '@openai/chatkit-react';
export function MyChat() {
const { control } = useChatKit({
api: {
async getClientSecret(existing) {
if (existing) {
// implement session refresh
}
const res = await fetch('/api/chatkit/session', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
});
const { client_secret } = await res.json();
return client_secret;
},
},
});
return <ChatKit control={control} className="h-[600px] w-[320px]" />;
}
This project is licensed under the Apache License 2.0.
TypeScript
31.2%
CSS
26.5%
MDX
21.9%
Astro
17.7%
JavaScript
2.6%
1,958
stars
176
commits
TypeScript
primary language
Jul 31, 2026
updated
ChatKit is a batteries-included framework for building high-quality, AI-powered chat experiences. It’s designed for developers who want to add advanced conversational intelligence to their apps fast—with minimal setup and no reinventing the wheel. ChatKit delivers a complete, production-ready chat interface out of the box.
Key features include:
Simply drop the ChatKit component into your app, configure a few options, and you're good to go.
ChatKit is a framework-agnostic, drop-in chat solution. You don’t need to build custom UIs, manage low-level chat state, or patch together various features yourself. Just add the ChatKit component, give it a client token, and customize the chat experience as needed, no extra work needed.
Generate a client token on your server.
from fastapi import FastAPI
from pydantic import BaseModel
from openai import OpenAI
import os
app = FastAPI()
openai = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
@app.post("/api/chatkit/session")
def create_chatkit_session():
session = openai.chatkit.sessions.create({
# ...
})
return { client_secret: session.client_secret }
Install the React bindings
npm install @openai/chatkit-react
Add the ChatKit JS script to your page
<script
src="https://cdn.platform.openai.com/deployments/chatkit/chatkit.js"
async
></script>
Render ChatKit
import { ChatKit, useChatKit } from '@openai/chatkit-react';
export function MyChat() {
const { control } = useChatKit({
api: {
async getClientSecret(existing) {
if (existing) {
// implement session refresh
}
const res = await fetch('/api/chatkit/session', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
});
const { client_secret } = await res.json();
return client_secret;
},
},
});
return <ChatKit control={control} className="h-[600px] w-[320px]" />;
}
This project is licensed under the Apache License 2.0.
TypeScript
31.2%
CSS
26.5%
MDX
21.9%
Astro
17.7%
JavaScript
2.6%