Lyra Cloudv1.0
LYRA API SPECIFICATION • v1.0

Developer Documentation

Ultra-fast music search, direct 320 kbps stream extraction, and binary chunked audio pipes built specifically for Telegram music bots and audio streaming applications.

Interactive Key Injector:Type your key to test snippets dynamically

Production Host

All queries are routed through encrypted high-speed HTTPS:

https://api.shnwaz.dev/api/v1

Authentication

Pass your API key as a query parameter or request header:

Query: ?api_key=eaLyra31e0
Header: x-api-key: eaLyra31e0

High Throughput

Zero rate limits, unlimited quota enabled by default:

UNLIMITED_QUOTA999,999,999 / day
Ready-to-Use Client Code
import httpx
from pyrogram import Client, filters
from pytgcalls import PyTgCalls
from pytgcalls.types import AudioPiped

app = Client("my_bot", api_id=12345, api_hash="your_api_hash", bot_token="your_bot_token")
call_py = PyTgCalls(app)

LYRA_STREAM_URL = "https://api.shnwaz.dev/api/v1/stream"
LYRA_KEY = "eaLyra31e0"

@app.on_message(filters.command("play") & filters.group)
async def play_handler(_, message):
    query = " ".join(message.command[1:])
    if not query:
        return await message.reply_text("Please provide a song name or YouTube link.")

    status_msg = await message.reply_text("⚡ Fetching audio stream via Lyra API...")

    async with httpx.AsyncClient() as client:
        res = await client.get(
            LYRA_STREAM_URL,
            params={"id": query, "api_key": LYRA_KEY},
            timeout=10.0
        )
        data = res.json()

    if data.get("status") != "success":
        return await status_msg.edit_text("❌ Failed to resolve music stream.")

    stream_url = data["stream_url"]
    song_title = data["title"]
    duration = data["duration"]

    # Direct audio stream into Telegram Voice Chat (zero local ffmpeg load)
    await call_py.join_group_call(
        message.chat.id,
        AudioPiped(stream_url)
    )

    await status_msg.edit_text(
        f"▶️ **Now Playing:** {song_title}\n⏱ **Duration:** {duration}\n⚡ **Latency:** {data['latency_ms']}ms"
    )

API Endpoints Reference

Live HTTP routes with parameter descriptions, interactive testing, and response samples

GET/api/v1/streamStreaming

Direct Playable Audio Stream

Resolves direct high-speed audio stream URLs (.m4a / .webm / 320 kbps CDN). Plug directly into Py-TgCalls without any local ffmpeg download or CPU transcoding.

Query & Body Parameters

FieldTypeRequiredDescription
idstringYesYouTube 11-char Video ID, full YouTube URL, or song query.
qualitystringNo'best', 'high', or 'low' (default: 'best').
api_keystringYesYour Lyra API key.

Example Response

{
  "status": "success",
  "id": "60ItHLz5WEA",
  "title": "Alan Walker - Faded",
  "channel": "Alan Walker",
  "duration": "03:32",
  "duration_seconds": 212,
  "thumbnail": "https://i.ytimg.com/vi/60ItHLz5WEA/maxresdefault.jpg",
  "stream_url": "https://rr3---sn-gwpa-25ued.googlevideo.com/videoplayback?...",
  "proxy_stream_url": "https://api.shnwaz.dev/api/v1/stream/raw?id=60ItHLz5WEA&api_key=eaLyra31e0",
  "format": "m4a",
  "bitrate": 320.0,
  "filesize": 3418520,
  "latency_ms": 12.4
}
GET/api/v1/stream/rawStreaming

Raw Chunked Audio Pipe

Direct chunked binary audio stream over HTTP. Lyra proxies and streams the audio buffer seamlessly without requiring client direct connections to YouTube CDNs.

Query & Body Parameters

FieldTypeRequiredDescription
idstringYesYouTube Video ID or URL.
api_keystringYesYour Lyra API key.

Example Response

HTTP/1.1 200 OK
Content-Type: audio/mp4
Transfer-Encoding: chunked

[Binary chunked audio stream ready for native media players and Py-TgCalls]
GET/api/v1/downloadDownload

Direct Song File Download

Triggers direct file download attachment with automatic sanitized song filename in the Content-Disposition header.

Query & Body Parameters

FieldTypeRequiredDescription
idstringYesYouTube Video ID or URL.
api_keystringYesYour Lyra API key.

Example Response

HTTP/1.1 200 OK
Content-Disposition: attachment; filename="Alan_Walker_Faded.m4a"
Content-Type: audio/mp4

[Direct Binary Audio Download]
POST/api/v1/keys/generateManagement

Create Developer API Key

Provision a new API key with unlimited throughput and 999,999,999 daily request quota.

Query & Body Parameters

FieldTypeRequiredDescription
emailstring (body)YesDeveloper's email address.
namestring (body)NoFriendly application label (e.g. 'Telegram Music Bot').
planstring (body)NoSubscription tier ('unlimited').

Example Response

{
  "status": "success",
  "key": "eaLyra31e0",
  "user_email": "developer@shnwaz.dev",
  "user_name": "My Telegram Music Bot",
  "plan": "unlimited",
  "daily_requests_limit": 999999999,
  "daily_video_limit": 999999999,
  "expires_at": "2027-10-01T00:00:00Z",
  "is_active": true
}
GET/api/v1/keys/usageManagement

Inspect Quota & Key Status

Query live consumption metrics, daily stream counts, and key validity in real time.

Query & Body Parameters

FieldTypeRequiredDescription
keystringYesYour Lyra API Key.

Example Response

{
  "status": "success",
  "key": "eaLyra31e0",
  "plan": "unlimited",
  "requests_today": 18,
  "daily_requests_limit": 999999999,
  "video_requests_today": 4,
  "daily_video_limit": 999999999,
  "expires_at": "2027-10-01T00:00:00Z",
  "percent_used": 0.0
}