openai-chatkit-backend-python

Build a self-hosted Python ChatKit backend with the OpenAI Agents SDK.

1|Updated Dec 4, 2025
One-click install
npx skills add https://github.com/Hamza123545/Todo_giaic_five_phases --skill openai-chatkit-backend-python-hamza123545
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openai-chatkit-backend-python
Source: https://github.com/Hamza123545/Todo_giaic_five_phases/tree/main/.claude/skills/openai-chatkit-backend-python
Command: npx skills add https://github.com/Hamza123545/Todo_giaic_five_phases --skill openai-chatkit-backend-python-hamza123545

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables building a self-hosted Python backend for ChatKit using the OpenAI Agents SDK.

Core Features & Use Cases

  • Provides a stable, opinionated backend architecture that separates ChatKit transport from Agents SDK reasoning.
  • Enables custom endpoints (e.g., /chatkit/api) with streaming support via Runner.run_streamed() and stream_agent_response().
  • Supports plug-in of tools, widgets, and client-side interactions while keeping keys and config on the server.

Quick Start

Install the required packages: pip install openai-chatkit agents fastapi uvicorn Create a minimal FastAPI app exposing /chatkit/api and wire ChatKit events to an Agent via create_model() factory. Implement a single, centralized model factory (create_model) and ensure the backend uses Runner.run_streamed() for streaming responses. Run the server and point the ChatKit frontend to your /chatkit/api endpoint.

Frequently Asked Questions about openai-chatkit-backend-python

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a self-hosted Python backend for ChatKit using the OpenAI Agents SDK?

To build a self-hosted ChatKit backend, expose a custom endpoint like /chatkit/api in a framework such as FastAPI, wire ChatKit events to an Agent via a centralized create_model() factory, and use Runner.run_streamed() for streaming responses.

What is the best way to separate ChatKit transport logic from OpenAI Agents SDK reasoning?

Separating ChatKit transport from Agents SDK reasoning requires a stable backend architecture that enforces a single create_model() factory, ensuring client-side interactions and server-side tool executions remain distinct layers.

Can I use Django or Flask instead of FastAPI for a ChatKit backend with streaming support?

Yes, Django and Flask are supported frameworks for building a ChatKit backend. You can implement custom endpoints in any of these Python frameworks and enable streaming support by utilizing Runner.run_streamed() and stream_agent_response().

How do I stream agent responses to a ChatKit frontend in Python?

Streaming agent responses to a ChatKit frontend uses Runner.run_streamed() and stream_agent_response() on the backend. Point your ChatKit frontend to the custom API endpoint to receive the streamed data.

Do I need a specific model factory setup to plug tools into my ChatKit backend?

Yes, you must implement a single, centralized model factory called create_model(). This setup allows you to plug in tools and widgets while keeping API keys and configurations securely on the server side.

Why does my ChatKit backend need to separate transport logic from agent reasoning?

Separating transport logic from agent reasoning keeps keys and config on the server, supports plug-in tools and widgets, and preserves a clear architecture so streaming via Runner.run_streamed() functions without backend interference.