All posts
agent-docs
AI Song Lyrics Writer — Agent Skill for AI Pass
Agent skill for writing complete song lyrics in any genre. Full Python implementation with AI Pass API.
EiliyaMarch 18, 20262 min read
AI Song Lyrics Writer Agent Skill — AI Pass API
Skill for: Generating complete song lyrics for any genre, mood, and theme API: AI Pass Chat Completions Endpoint: https://aipass.one/apikey/v1/chat/completions
Skill Definition
name: song-lyrics-writer
description: Generates complete song lyrics with verse/chorus/bridge structure for any genre and mood.
version: 1.0.0
auth:
type: api_key
env: AIPASS_API_KEY
Implementation
import os
import requests
AIPASS_API_KEY = os.environ["AIPASS_API_KEY"]
BASE_URL = "https://aipass.one/apikey/v1"
def write_song_lyrics(
topic: str,
genre: str = "pop",
mood: str = "upbeat",
include_phrases: list = None
) -> dict:
"""
Generate complete song lyrics.
Args:
topic: Song theme or subject
genre: Music genre (pop, rap, country, R&B, rock, EDM, indie, etc.)
mood: Emotional mood/vibe
include_phrases: Optional list of phrases/words to include
Returns:
dict with lyrics text and metadata
"""
phrases_instruction = ""
if include_phrases:
phrases_instruction = f"\nMust incorporate these phrases: {', '.join(include_phrases)}"
response = requests.post(
f"{BASE_URL}/chat/completions",
headers={
"Authorization": f"Bearer {AIPASS_API_KEY}",
"Content-Type": "application/json"
},
json={
"model": "gpt-5-mini",
"temperature": 1,
"max_tokens": 16000,
"messages": [
{
"role": "system",
"content": f"You are a professional songwriter specializing in {genre}. Write authentic, singable lyrics with proper rhyme scheme, emotional depth, and genre-appropriate language."
},
{
"role": "user",
"content": f"""Write complete {genre} song lyrics about: "{topic}"
Mood/vibe: {mood}{phrases_instruction}
Structure:
[Verse 1]
[Chorus]
[Verse 2]
[Chorus]
[Bridge]
[Final Chorus]
Make each section 4-8 lines. Ensure the chorus is catchy and memorable."""
}
]
}
)
result = response.json()
lyrics = result["choices"][0]["message"]["content"]
return {
"lyrics": lyrics,
"topic": topic,
"genre": genre,
"mood": mood,
"model": "gpt-5-mini"
}
Usage Examples
# Set your API key
import os
os.environ["AIPASS_API_KEY"] = "$AIPASS_API_KEY"
# Pop song
result = write_song_lyrics(
topic="late night city drives and nostalgia",
genre="pop",
mood="melancholic yet hopeful"
)
print(result["lyrics"])
# Rap track
rap = write_song_lyrics(
topic="grinding from nothing to success",
genre="rap/hip-hop",
mood="fierce and motivational",
include_phrases=["level up", "no days off"]
)
print(rap["lyrics"])
# Country song
country = write_song_lyrics(
topic="small town summer romance",
genre="country",
mood="warm and nostalgic"
)
print(country["lyrics"])
Supported Genres
pop, rap/hip-hop, R&B/soul, country, rock, EDM/electronic, indie folk, reggaeton, jazz, blues, k-pop, metal
Agent Tool Definition
{
"type": "function",
"function": {
"name": "write_song_lyrics",
"description": "Generates complete song lyrics for any genre. Use when a user wants song lyrics, needs a custom song, or wants to write music.",
"parameters": {
"type": "object",
"properties": {
"topic": {"type": "string", "description": "Song theme or subject matter"},
"genre": {"type": "string", "description": "Music genre"},
"mood": {"type": "string", "description": "Emotional vibe of the song"},
"include_phrases": {
"type": "array",
"items": {"type": "string"},
"description": "Specific phrases to include"
}
},
"required": ["topic"]
}
}
}
Get Started
- Sign up at aipass.one
- Go to Developer Dashboard → API Keys
- Set
AIPASS_API_KEYin your environment
Try the app: aipass.one/apps/lyrics-writer
Related skills: