openai-chatkit-backend-python

Implement a Python ChatKit backend with OpenAI Agents SDK and SSE streaming.

2|Updated Nov 30, 2025
One-click install
npx skills add https://github.com/zeeshan080/ai-native-robotics --skill openai-chatkit-backend-python
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openai-chatkit-backend-python
Source: https://github.com/zeeshan080/ai-native-robotics/tree/main/.claude/skills/openai-chatkit-backend-python
Command: npx skills add https://github.com/zeeshan080/ai-native-robotics --skill openai-chatkit-backend-python

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Build and run a self-hosted ChatKit backend in Python, decoupled from Agent Builder, orchestrating with the OpenAI Agents SDK and optionally Gemini via an OpenAI-compatible endpoint.

Core Features & Use Cases

  • Custom backend endpoints: /chatkit/api and optional /chatkit/api/upload
  • Agents SDK integration for reasoning and tools
  • Streaming responses via Server-Sent Events (SSE)
  • Store and FileStore contracts for persistence and uploads
  • Security: server-side keys and domain allowlists

Quick Start

Run the provided FastAPI example with /chatkit/api, configure environment variables (LLM_PROVIDER, OPENAI_API_KEY, GEMINI_API_KEY, etc.), and connect the frontend ChatKit widget by pointing it 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 ChatKit backend in Python?

Design a self-hosted ChatKit backend by creating FastAPI endpoints (/chatkit/api and optional /chatkit/api/upload), integrating the OpenAI Agents SDK, configuring a provider factory to switch between OpenAI and Gemini, and implementing Server-Sent Events for response streaming while enforcing store contracts and protecting API keys server-side.

Can I run ChatKit on my own infrastructure with Python and FastAPI?

Yes. ChatKit runs on custom Python infrastructure via FastAPI, Django, or Flask backends that expose the required /chatkit/api endpoint, manage agent orchestration through the OpenAI Agents SDK, and handle authentication and persistence through store and FileStore contracts.

What's required to connect the ChatKit frontend to a Python backend?

Point the ChatKit frontend widget to your backend's /chatkit/api endpoint. Configure environment variables (LLM_PROVIDER, OPENAI_API_KEY, GEMINI_API_KEY) server-side, implement streaming via Server-Sent Events, and maintain clean frontend/backend separation with proper authentication and no API key exposure.

How do I integrate the OpenAI Agents SDK with ChatKit in Python?

Use the Agents SDK within your Python backend to orchestrate reasoning and tool execution. Implement a provider factory (create_model) to instantiate agents, route chat requests through /chatkit/api, stream agent responses via SSE, and optionally support Gemini through an OpenAI-compatible endpoint.

Does ChatKit support streaming responses and file uploads in a self-hosted backend?

Yes. Self-hosted backends stream chat responses via Server-Sent Events through /chatkit/api and handle file uploads via optional POST /chatkit/api/upload, with uploads managed through the FileStore contract and proper server-side authentication.

What limitations apply when switching between OpenAI and Gemini in a ChatKit backend?

Gemini requires an OpenAI-compatible endpoint to work alongside OpenAI in ChatKit backends. The provider factory must correctly instantiate models based on configuration, and both providers must adhere to the Agents SDK interface for consistent reasoning and tool execution behavior.