kryten-api-gate
HTTP REST gateway for the Kryten ecosystem — exposes kryten-py via FastAPI.
Overview
kryten-api-gate sits between HTTP clients and the Kryten NATS message bus, translating REST calls into KrytenClient commands dispatched to Kryten-Robot.
HTTP Client → kryten-api-gate → KrytenClient → NATS → Kryten-Robot → CyTube
Installation
pip install kryten-api-gate
Quick Start
-
Copy
config.example.jsontoconfig.jsonand fill in your values:{ "nats_url": "nats://localhost:4222", "channel": "your-channel", "api_key": "your-secret-api-key", "host": "0.0.0.0", "port": 8080 }
-
Run the server:
kryten-api-gate # or python -m kryten_api_gate
-
Interactive API docs at
http://localhost:8080/docs
Authentication
All endpoints (except /api/v1/system/health and /api/v1/system/version) require a Bearer token:
Authorization: Bearer <api_key>
API Routes
| Prefix | Description |
|---|---|
GET /api/v1/system/health |
Health check (unauthenticated) |
GET /api/v1/system/version |
Version info (unauthenticated) |
POST /api/v1/chat/send |
Send a chat message |
GET/POST /api/v1/playlist/ |
Playlist management |
POST /api/v1/playback/ |
Playback control |
POST /api/v1/moderation/ |
Moderation actions |
GET/POST /api/v1/admin/ |
Admin channel settings |
GET/POST /api/v1/emotes/ |
Emote management |
GET/POST /api/v1/filters/ |
Chat filter management |
GET/POST /api/v1/polls/ |
Poll management |
GET /api/v1/library/ |
Media library search |
GET/PUT/DELETE /api/v1/kv/ |
Key-value store |
GET /api/v1/state/ |
Channel state queries |
Configuration
| Key | Description | Default |
|---|---|---|
nats_url |
NATS server URL | nats://localhost:4222 |
channel |
CyTube channel name | required |
api_key |
API authentication key | required |
host |
Listen address | 0.0.0.0 |
port |
Listen port | 8080 |
log_level |
Logging level | info |
Systemd Service
A systemd unit file is provided at systemd/kryten-api-gate.service.
Development
git clone https://github.com/grobertson/kryten-api-gate
cd kryten-api-gate
pip install -e ".[dev]"
uvicorn kryten_api_gate.app:create_app --factory --reload
License
MIT
Metadata
Release files for kryten-api-gate 0.8.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kryten_api_gate-0.8.4.tar.gz | 165.6 kB | Without provenance | Details for kryten_api_gate-0.8.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kryten_api_gate-0.8.4-py3-none-any.whl | Python 3 | none | any | Details for kryten_api_gate-0.8.4-py3-none-any.whl |
Total release size: 187.9 kB
Release files / kryten_api_gate-0.8.4.tar.gz
| Download URL | kryten_api_gate-0.8.4.tar.gz |
|---|---|
| Size | 165.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a60abbca0db3c91f2452bd545e35dfe55ea5bc630235fcd833bae145ebf1ffa7
|
|
BLAKE2b-256 checksum How to use checksums |
5c052e1c0264239551e8c2dde3cc6be6b7d74d2ac3e0189cae76cfbd16b7e4ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / kryten_api_gate-0.8.4-py3-none-any.whl
| Download URL | kryten_api_gate-0.8.4-py3-none-any.whl |
|---|---|
| Size | 22.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
31a8fd34363604c6d1b481a1b53df1ffca6b41988faf586734af383846c7da2f
|
|
BLAKE2b-256 checksum How to use checksums |
0fdcfd502f0e7906162cc5ec6e582e02b73cc8eea2b30d2dd2433c33087f384f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for kryten-api-gate 0.8.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.