🏠 Home ✨ Create Paste 📖 API Docs 🐙 GitHub
Documentation v1.0

KaguneBin Documentation

Official API and Python SDK Documentation

KaguneBin is a modern paste sharing platform built for developers. Create secure, shareable pastes with password protection, expiration support, burn-after-read functionality, and syntax highlighting.

View SDK API Reference GitHub

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

https://kagunebin.vercel.app

Tip: All requests use HTTPS. No authentication is required to create pastes — KaguneBin is anonymous by design.

GET /status

Health check endpoint. Returns service status.

Response

JSON
{
  "status": "ok",
  "service": "KaguneBin"
}
POST /paste

Create a new paste. Returns the paste ID and shareable URL.

Request Parameters

ParameterTypeRequiredDescription
titlestringoptionalTitle of the paste (defaults to "").
contentstringrequiredPaste body content.
syntaxstringoptionalSyntax language (e.g. python). Defaults to "text".
securityobjectoptionalNested security settings. See fields below.
security.is_protectedbooleanoptionalWhether the paste requires a password.
security.passwordstringoptionalPassword (required if is_protected is true).
security.is_burn_after_readbooleanoptionalDestroy paste after first view.
is_expirybooleanoptionalEnable expiration.
expiry_datestring (YYYY-MM-DD)optionalExpiration date.
expiry_hourinteger (0–23)optionalExpiration hour.
expiry_minuteinteger (0–59)optionalExpiration minute.
tz_offset_minutesintegeroptionalClient timezone offset in minutes (e.g. -330 for IST).

Request Example

JSON
{
  "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

JSON
{
  "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" }
}
GET /api/paste/{paste_id}

Retrieve full details for a paste, including content and metadata.

Query Parameters

ParameterTypeRequiredDescription
passwordstringoptionalRequired if paste is password protected.

Request Example

HTTP
GET /api/paste/kgn_a1b2c3d4?password=secret123

Response Example

JSON
{
  "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" }
}
GET /raw/{paste_id}

Retrieve the raw, plaintext content of a paste. Ideal for scripts and curl pipelines.

HTTP
GET /raw/kgn_a1b2c3d4
# Response: text/plain
print('Hello, Kagune')
GET /download/{paste_id}

Download a paste as a file with an appropriate extension based on its syntax.

HTTP
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

bash
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

python
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

python
client = KaguneBin(base_url="https://kagunebin.vercel.app")

create() — Create a paste

Create a new paste with optional password protection and burn-after-read.

ParameterTypeDefaultDescription
titlestrPaste title (required).
contentstrPaste content (required).
syntaxstr"plaintext"Language for syntax highlighting. Must be in SYNTAXES.
passwordstrNoneIf set, the paste is password-protected.
burn_after_readboolFalseDestroy 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.

python
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.

python
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.

python
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.

python
data = client.download("kgn_a1b2c3d4")
with open("snippet.py", "wb") as f:
    f.write(data)

syntaxes()

Returns a copy of every supported syntax language.

python
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).

python
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

bash
pip install pyrogram tgcrypto kagunebin

Full Bot Example

This bot listens for any text message, creates a KaguneBin paste, and replies with the URL.

python
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

bash
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

bash
curl https://kagunebin.vercel.app/api/paste/kgn_a1b2c3d4

Raw content

bash
curl https://kagunebin.vercel.app/raw/kgn_a1b2c3d4

Download content

bash
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.

400
Bad Request

Missing or malformed parameters in your request.

401
Unauthorized

Password is missing or incorrect for a protected paste.

404
Not Found

The requested paste does not exist or has been burned.

410
Expired Paste

The paste expired and is no longer available.

500
Internal Server Error

Something went wrong on our side. Try again shortly.

Error Response Example

JSON
{
  "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.

KaguneBin Website

The full source code for the KaguneBin web app.

View Repo

KaguneBin Python SDK

The official Python SDK source on GitHub.

View Repo