Back to Home

Documentation

G2 Storage is an S3-compatible API. Use any S3 SDK or tool!

Quick Start

Configure any S3 client to use G2 Storage by pointing to our endpoint with your bucket credentials.

// JavaScript/Node.js Example
import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";

const client = new S3Client({
    endpoint: "https://g2-backend.fikri-afa289.workers.dev/g2",
    region: "auto",
    credentials: {
        accessKeyId: "YOUR_ACCESS_KEY",
        secretAccessKey: "YOUR_SECRET_KEY",
    },
    forcePathStyle: true,
});

// Upload a file
await client.send(new PutObjectCommand({
    Bucket: "your-bucket",
    Key: "hello.txt",
    Body: "Hello, World!",
}));

External Resources

Since G2 Storage is S3-compatible, you can use any existing AWS S3 documentation and tools.

API Limits

Max File Size

20 MB per file (Telegram limit)

Storage Capacity

Unlimited (Telegram infrastructure)

Request Rate

Telegram API rate limits apply

Buckets

Unlimited buckets per account