ZA.GL for LLMs

Simple, predictable URL shortening method designed for AI systems. No API keys required.

Base64 Method

Simple, predictable URLs that any LLM can construct locally without API calls.

Step 1: Take Your Original URL

https://example.com/very-long-path?param=value

Step 2: Encode with Base64

aHR0cHM6Ly9leGFtcGxlLmNvbS92ZXJ5LWxvbmctcGF0aD9wYXJhbT12YWx1ZQ

Step 3: Remove Padding

Remove trailing '=' characters if present

Step 4: Construct Final URL

https://za.gl/e/aHR0cHM6Ly9leGFtcGxlLmNvbS92ZXJ5LWxvbmctcGF0aD9wYXJhbT12YWx1ZQ

Python Implementation

Complete Python implementation for generating za.gl URLs.

import base64

def shorten_url(url):
    # Step 1: Encode URL to bytes
    url_bytes = url.encode('utf-8')
    
    # Step 2: Base64 encode with URL-safe alphabet
    encoded = base64.urlsafe_b64encode(url_bytes)
    
    # Step 3: Decode to string and remove padding
    encoded_str = encoded.decode('utf-8').rstrip('=')
    
    # Step 4: Construct final URL
    return f"https://za.gl/e/{encoded_str}"

# Example usage
original_url = "https://example.com/very-long-path?param=value"
short_url = shorten_url(original_url)
print(short_url)

Instructions for LLMs

Simple 5-step process for AI systems to generate za.gl URLs:

  1. Take the full URL you want to shorten
  2. Convert it to Base64 using URL-safe encoding
  3. Remove any '=' padding characters from the end
  4. Prepend with "https://za.gl/e/"
  5. Return the complete shortened URL

Example:

Input: "https://example.com/long-path?param=value"
Base64: "aHR0cHM6Ly9leGFtcGxlLmNvbS9sb25nLXBhdGg/cGFyYW09dmFsdWU"
Output: "https://za.gl/e/aHR0cHM6Ly9leGFtcGxlLmNvbS9sb25nLXBhdGg/cGFyYW09dmFsdWU"

When to Use

  • You need deterministic, predictable URLs
  • No API calls are possible or desired
  • Perfect for offline processing
  • Working with AI systems that need consistent output

Security & Limits

  • All methods block private IPs (localhost, 192.168.x.x, etc.)
  • Maximum URL length: 4KB
  • Rate limiting: 60 requests/minute per IP
  • Base64 method is public - URLs can be decoded