About KaguneBin
KaguneBin is a fast, minimal, anonymous pastebin built for developers who value privacy and simplicity. Inspired by the dark aesthetic of Tokyo Ghoul, the platform pairs a striking visual identity with a developer-first feature set — making it the perfect home for code snippets, logs, configuration files, and temporary data.
KaguneBin was built because most existing paste services are either bloated with ads, tied to accounts, or lack the privacy controls developers actually need. KaguneBin is the opposite: fully anonymous by default, ridiculously fast, and free of distractions.
Core Principles
- Privacy-focused — no accounts, no tracking, no nonsense.
- Developer-first — clean REST API, official Python SDK, raw access.
- Fast & lightweight — powered by FastAPI and PostgreSQL.
- Tokyo Ghoul inspired — dark, blood-red aesthetic with a sharp edge.
- Open source — fully transparent and community-driven.
Highlight Features
Password Protection
Lock sensitive pastes behind a password.
Burn After Read
Auto-destroy paste content after a single view.
Expiration Support
Set a future expiry date and time for any paste.
Raw Content Access
Fetch plaintext directly via the raw endpoint.
Downloads
Download pastes as files with proper extensions.
Syntax Highlighting
Beautiful highlighting across many languages.
Statistics
Track view and download counts per paste.
Python SDK
Official SDK for automation and bot integrations.
Website Features
Everything KaguneBin offers, in one place.
Create Pastes
Share code snippets, logs, notes, and text instantly.
Password Protected
Require a password before viewing paste content.
Burn After Read
Auto-delete content after the first access.
Expiring Pastes
Automatically remove content at a chosen date and time.
Syntax Highlighting
Support for multiple programming languages.
Downloads
Download content as files with appropriate extensions.
Statistics
Track views and downloads for each paste.
REST API Reference
The KaguneBin API is a simple REST interface. All endpoints return JSON unless otherwise noted.
Base URL
Tip: All requests use HTTPS. No authentication is required to create pastes — KaguneBin is anonymous by design.
Health check endpoint. Returns service status.
Response
{
"status": "ok",
"service": "KaguneBin"
}
Create a new paste. Returns the paste ID and shareable URL.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | optional | Title of the paste (defaults to ""). |
content | string | required | Paste body content. |
syntax | string | optional | Syntax language (e.g. python). Defaults to "text". |
security | object | optional | Nested security settings. See fields below. |
security.is_protected | boolean | optional | Whether the paste requires a password. |
security.password | string | optional | Password (required if is_protected is true). |
security.is_burn_after_read | boolean | optional | Destroy paste after first view. |
is_expiry | boolean | optional | Enable expiration. |
expiry_date | string (YYYY-MM-DD) | optional | Expiration date. |
expiry_hour | integer (0–23) | optional | Expiration hour. |
expiry_minute | integer (0–59) | optional | Expiration minute. |
tz_offset_minutes | integer | optional | Client timezone offset in minutes (e.g. -330 for IST). |
Request Example
{
"title": "My Snippet",
"content": "print('Hello, Kagune')",
"syntax": "python",
"security": {
"is_protected": true,
"password": "secret123",
"is_burn_after_read": false
},
"is_expiry": true,
"expiry_date": "2026-12-31",
"expiry_hour": 23,
"expiry_minute": 59,
"tz_offset_minutes": -330
}
Response Example
{
"id": "kgn_a1b2c3d4",
"title": "My Snippet",
"content": "print('Hello, Kagune')",
"syntax": "python",
"url": "/p/kgn_a1b2c3d4",
"is_protected": true,
"is_burn_after_read": false,
"views": 0,
"downloads": 0,
"created_at": "2026-05-30T12:00:00+00:00",
"expires_at": "2026-12-31T23:59:00+00:00",
"security": { "is_protected": true, "is_burn_after_read": false },
"stats": { "views": 0, "downloads": 0 },
"timestamps": { "created_at": "2026-05-30T12:00:00+00:00", "expires_at": "2026-12-31T23:59:00+00:00" }
}
Retrieve full details for a paste, including content and metadata.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
password | string | optional | Required if paste is password protected. |
Request Example
GET /api/paste/kgn_a1b2c3d4?password=secret123
Response Example
{
"id": "kgn_a1b2c3d4",
"title": "My Snippet",
"content": "print('Hello, Kagune')",
"syntax": "python",
"url": "/p/kgn_a1b2c3d4",
"is_protected": true,
"is_burn_after_read": false,
"views": 42,
"downloads": 7,
"created_at": "2026-05-30T12:00:00+00:00",
"expires_at": "2026-12-31T23:59:00+00:00",
"security": { "is_protected": true, "is_burn_after_read": false },
"stats": { "views": 42, "downloads": 7 },
"timestamps": { "created_at": "2026-05-30T12:00:00+00:00", "expires_at": "2026-12-31T23:59:00+00:00" }
}
Retrieve the raw, plaintext content of a paste. Ideal for scripts and curl pipelines.
GET /raw/kgn_a1b2c3d4 # Response: text/plain print('Hello, Kagune')
Download a paste as a file with an appropriate extension based on its syntax.
GET /download/kgn_a1b2c3d4
# Response: Content-Disposition: attachment; filename="kgn_a1b2c3d4.py"
Official KaguneBin Python SDK
The official Python SDK gives you a lightweight, friendly wrapper around the REST API. Perfect for automation, scripts, CLI tools, and bot integrations.
Installation
pip install kagunebin
Why use the SDK?
- Lightweight — zero bloat, single dependency.
- Simple API — readable, Pythonic method names.
- Automation friendly — ideal for CI/CD pipelines.
- Bot friendly — works seamlessly with Pyrogram, Telethon, Discord.py.
Quick Start
from kagunebin import KaguneBin client = KaguneBin() paste = client.create( title="Hello", content="print('Paste Fear. Share Power.')", syntax="python", ) # create() returns the API JSON as a dict print(paste["id"], paste["url"])
Constructor
client = KaguneBin(base_url="https://kagunebin.vercel.app")
create() — Create a paste
Create a new paste with optional password protection and burn-after-read.
| Parameter | Type | Default | Description |
|---|---|---|---|
title | str | — | Paste title (required). |
content | str | — | Paste content (required). |
syntax | str | "plaintext" | Language for syntax highlighting. Must be in SYNTAXES. |
password | str | None | If set, the paste is password-protected. |
burn_after_read | bool | False | Destroy after first view. |
The SDK does not currently expose expiration parameters — use the REST API directly if you need is_expiry, expiry_date, expiry_hour, and expiry_minute.
paste = client.create( title="Secret Config", content="API_KEY=xxx", syntax="bash", password="hunter2", burn_after_read=True, ) print(paste["url"])
get(paste_id, password=None) — Retrieve a paste
Returns the full paste payload as a dict.
paste = client.get("kgn_a1b2c3d4", password="hunter2") print(paste["title"]) print(paste["content"])
raw(paste_id, password=None) — Raw text
Returns the plaintext content as a str.
text = client.raw("kgn_a1b2c3d4") print(text)
download(paste_id, password=None) — File bytes
Returns the file content as bytes. Write it to disk yourself.
data = client.download("kgn_a1b2c3d4") with open("snippet.py", "wb") as f: f.write(data)
syntaxes()
Returns a copy of every supported syntax language.
langs = client.syntaxes() print(langs) # ['python', 'javascript', 'typescript', 'java', 'cpp', 'c', ...]
is_valid_syntax(syntax)
Validates whether a given syntax name is supported (case-insensitive).
client.is_valid_syntax("python") # True client.is_valid_syntax("klingon") # False
Telegram Bot Integration
Combine the KaguneBin SDK with Pyrogram to build a Telegram bot that turns any message into a shareable paste in seconds.
Installation
pip install pyrogram tgcrypto kagunebin
Full Bot Example
This bot listens for any text message, creates a KaguneBin paste, and replies with the URL.
from pyrogram import Client, filters from kagunebin import KaguneBin API_ID = 123456 API_HASH = "your_api_hash" BOT_TOKEN = "your_bot_token" app = Client("kagune-bot", api_id=API_ID, api_hash=API_HASH, bot_token=BOT_TOKEN) kagune = KaguneBin() @app.on_message(filters.text & ~filters.command(["start"])) async def paste_handler(client, message): paste = kagune.create( title=f"From @{message.from_user.username}", content=message.text, syntax="python", ) await message.reply_text(f"🩸 Paste created:\n{paste["url"]}") @app.on_message(filters.command("start")) async def start(client, message): await message.reply_text("Send me any text and I'll paste it on KaguneBin.") app.run()
That's it. Send your bot any message — it instantly creates a paste and replies with a clean KaguneBin URL.
cURL Examples
Quick reference for hitting the API directly from your shell.
Create a paste
curl -X POST https://kagunebin.vercel.app/paste \ -H "Content-Type: application/json" \ -d '{ "title": "My Snippet", "content": "print(\"Hello\")", "syntax": "python" }'
Retrieve paste details
curl https://kagunebin.vercel.app/api/paste/kgn_a1b2c3d4
Raw content
curl https://kagunebin.vercel.app/raw/kgn_a1b2c3d4
Download content
curl -O -J https://kagunebin.vercel.app/download/kgn_a1b2c3d4
Error Handling
KaguneBin uses standard HTTP status codes. All errors return JSON with a consistent shape.
Missing or malformed parameters in your request.
Password is missing or incorrect for a protected paste.
The requested paste does not exist or has been burned.
The paste expired and is no longer available.
Something went wrong on our side. Try again shortly.
Error Response Example
{
"success": false,
"error": "unauthorized",
"message": "Invalid password for this paste.",
"status": 401
}
Frequently Asked Questions
Burn-after-read pastes are automatically deleted the moment they are viewed for the first time. Perfect for one-time secrets, tokens, and short-lived messages.
You can set a future date, hour, and minute when creating a paste. Once that time passes, the paste is permanently removed and any subsequent request returns a 410 Expired response.
When a paste is protected, the API requires the correct password query parameter (or SDK argument) to return the content. Without it, the request fails with 401 Unauthorized.
Hit the /download/{paste_id} endpoint. The server returns the content with a Content-Disposition header so browsers and curl save it as a file with the correct extension.
Install with pip install kagunebin, instantiate KaguneBin(), then call create(), get(), raw(), or download(). See the Python SDK section above for full examples.
Open Source
KaguneBin is fully open source. Contributions, issues, and stars are always welcome.