LLM URL 단축
AI 시스템과 호환되는 예측 가능한 URL 단축을 위한 Base64 인코딩
개요
ZAGL은 예측 가능하고 재현 가능한 짧은 URL을 위해 Base64 인코딩을 사용하는 LLM 친화적인 URL 단축을 제공합니다. API 키나 복잡한 인증 없이 일관된 URL 생성이 필요한 AI 애플리케이션에 이상적입니다.
LLM 호환
AI 시스템을 위해 설계
예측 가능
같은 URL은 항상 같은 짧은 코드 생성
API 키 불필요
간단한 HTTP 요청
API 레퍼런스
URL 인코딩
POST /api/llm/encode요청 본문
{ "url": "https://example.com/long/url/path" }
응답
{ "success": true, "data": { "shortUrl": "https://za.gl/e/aHR0cHM6Ly9...", "encoded": "aHR0cHM6Ly9leGFtcGxl...", "originalUrl": "https://example.com/...", "method": "base64", "expires": null, "createdAt": "2024-01-01T00:00:00Z" } }
짧은 URL 접근
GET /e/{base64}짧은 URL을 방문하면 자동으로 원래 URL로 리다이렉트됩니다. Base64 인코딩된 문자열에는 원래 URL이 포함되어 있으며 예측 가능하게 디코딩할 수 있습니다.
분석
GET /api/llm/analytics?days=30&format=jsonLLM 생성 URL에 대한 분석 데이터를 가져옵니다. JSON 및 CSV 형식을 지원합니다.
쿼리 매개변수
days: 일수 (1-365, 기본값: 30)format: 응답 형식 (json 또는 csv, 기본값: json)
제한 및 사양
속도 제한
- • 인코딩:: 60 requests/minute
- • 리다이렉트:: 60 requests/minute
- • 분석:: 120 requests/minute
제약 사항
- • 최대 URL 길이: 4KB
- • 프로토콜: HTTP, HTTPS만
- • 개인 IP: 보안상 차단됨
- • 만료: 없음 (영구 URL)
코드 예제
Python
llm_shortener.py
import base64 import urllib.parse import requests def shorten_url_llm(url): """ Create a predictable shortened URL using Base64 encoding Compatible with ZAGL LLM functionality """ # Validate URL if len(url) > 4096: raise ValueError("URL exceeds 4KB limit") # Encode to Base64 encoded_bytes = base64.b64encode(url.encode('utf-8')) encoded_str = encoded_bytes.decode('utf-8') # Remove padding for cleaner URLs clean_encoded = encoded_str.rstrip('=') # Generate short URL short_url = f"https://yourdomain.com/e/{clean_encoded}" return { "short_url": short_url, "encoded": clean_encoded, "original_url": url } def decode_llm_url(encoded_url): """ Decode a Base64 encoded URL """ # Add padding back if needed padding_needed = 4 - (len(encoded_url) % 4) if padding_needed != 4: encoded_url += '=' * padding_needed # Decode decoded_bytes = base64.b64decode(encoded_url) return decoded_bytes.decode('utf-8') # Example usage original_url = "https://example.com/very/long/url/path" result = shorten_url_llm(original_url) print(f"Short URL: {result['short_url']}") print(f"Encoded: {result['encoded']}")
JavaScript/Node.js
llm_shortener.js
// JavaScript/Node.js implementation function shortenUrlLLM(url) { // Validate URL if (url.length > 4096) { throw new Error("URL exceeds 4KB limit"); } // Validate URL format try { new URL(url); } catch { throw new Error("Invalid URL format"); } // Encode to Base64 const base64 = Buffer.from(url, 'utf-8').toString('base64'); // Remove padding for cleaner URLs const cleanBase64 = base64.replace(/=/g, ''); // Generate short URL const shortUrl = `https://yourdomain.com/e/${cleanBase64}`; return { shortUrl, encoded: cleanBase64, originalUrl: url }; } function decodeLLMUrl(encodedUrl) { // Add padding back if needed let paddedBase64 = encodedUrl; while (paddedBase64.length % 4) { paddedBase64 += '='; } // Decode from Base64 return Buffer.from(paddedBase64, 'base64').toString('utf-8'); } // Example usage const originalUrl = "https://example.com/very/long/url/path"; const result = shortenUrlLLM(originalUrl); console.log(`Short URL: ${result.shortUrl}`); console.log(`Encoded: ${result.encoded}`);
터미널 / cURL
terminal
# Encode a URL curl -X POST https://za.gl/api/llm/encode \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com/very/long/url/path"}' # Get analytics curl "https://za.gl/api/llm/analytics?days=7&format=json" # Get analytics as CSV curl "https://za.gl/api/llm/analytics?days=30&format=csv" \ -o analytics.csv
사용 사례
LLM 애플리케이션
- • ChatGPT 플러그인 및 통합
- • Claude Code 및 AI 개발 도구
- • 자동화된 콘텐츠 생성
- • AI 기반 링크 공유
자동화 및 스크립팅
- • CI/CD 파이프라인
- • 웹훅 통합
- • 배치 URL 처리
- • 문서 생성기
호환: za.gl/llm-docs 사양
최종 업데이트: 1/13/2026