AI
Pass

AI Horoscope Generator — Agent Skill

AI Horoscope Generator — Agent Skill

Generate personalized daily horoscopes for all zodiac signs using AI Pass chat completions.

Setup

Get API key: https://aipass.one/panel/developer.html → API Keys

export AIPASS_API_KEY="your-key-here"

Generate Horoscope

import requests
import os

AIPASS_API_KEY = os.environ["AIPASS_API_KEY"]

ZODIAC_SIGNS = [
    "Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo",
    "Libra", "Scorpio", "Sagittarius", "Capricorn", "Aquarius", "Pisces"
]

def generate_horoscope(sign):
    """Generate a daily horoscope for the given zodiac sign.
    
    Args:
        sign: Zodiac sign (e.g., "Aries", "Leo", "Pisces")
    
    Returns:
        Formatted horoscope text
    """
    
    if sign not in ZODIAC_SIGNS:
        raise ValueError(f"Invalid sign. Choose from: {', '.join(ZODIAC_SIGNS)}")
    
    response = requests.post(
        "https://aipass.one/apikey/v1/chat/completions",
        headers={
            "Authorization": f"Bearer {AIPASS_API_KEY}",
            "Content-Type": "application/json"
        },
        json={
            "model": "gpt-5-mini",
            "messages": [
                {
                    "role": "system",
                    "content": "You are an expert astrologer. Create a personalized daily horoscope with these sections: Daily Forecast, Love & Relationships, Career & Work, Health & Wellness, Lucky Numbers (3 specific numbers), and Color of the Day (one color). Be inspiring, mystical yet practical, and specific to the sign's traits."
                },
                {
                    "role": "user",
                    "content": f"Create today's horoscope for {sign}. Include all sections with personalized advice specific to {sign}'s characteristics."
                }
            ]
        }
    )
    
    if response.status_code != 200:
        raise Exception(f"Error: {response.text}")
    
    return response.json()["choices"][0]["message"]["content"]

# Example usage
if __name__ == "__main__":
    sign = "Leo"
    horoscope = generate_horoscope(sign)
    print(f"\n{'='*50}")
    print(f"TODAY'S HOROSCOPE FOR {sign.upper()}")
    print(f"{'='*50}")
    print(horoscope)
    print(f"{'='*50}")

Generate for All Signs

def generate_all_horoscopes():
    """Generate horoscopes for all 12 zodiac signs."""
    horoscopes = {}
    for sign in ZODIAC_SIGNS:
        print(f"Generating for {sign}...")
        try:
            horoscopes[sign] = generate_horoscope(sign)
        except Exception as e:
            print(f"Error for {sign}: {e}")
            horoscopes[sign] = None
    return horoscopes

# Usage
all_horoscopes = generate_all_horoscopes()
for sign, text in all_horoscopes.items():
    if text:
        with open(f"{sign.lower()}-horoscope.txt", 'w') as f:
            f.write(text)

Get Zodiac Sign from Date

import datetime

def get_zodiac_sign(month, day):
    """Get zodiac sign from birth date.
    
    Args:
        month: Month (1-12)
        day: Day (1-31)
    
    Returns:
        Zodiac sign name
    """
    zodiac_dates = [
        ((1, 20), (2, 18), "Aquarius"),
        ((2, 19), (3, 20), "Pisces"),
        ((3, 21), (4, 19), "Aries"),
        ((4, 20), (5, 20), "Taurus"),
        ((5, 21), (6, 20), "Gemini"),
        ((6, 21), (7, 22), "Cancer"),
        ((7, 23), (8, 22), "Leo"),
        ((8, 23), (9, 22), "Virgo"),
        ((9, 23), (10, 22), "Libra"),
        ((10, 23), (11, 21), "Scorpio"),
        ((11, 22), (12, 21), "Sagittarius"),
        ((12, 22), (1, 19), "Capricorn")
    ]
    
    for (start_m, start_d), (end_m, end_d), sign in zodiac_dates:
        if (month == start_m and day >= start_d) or (month == end_m and day <= end_d):
            return sign
    return "Unknown"

# Example
sign = get_zodiac_sign(8, 15)  # August 15
print(f"Born August 15: {sign}")  # Leo

Notes

  • Model: gpt-5-mini (best balance)
  • All 12 zodiac signs supported
  • Output: Formatted text with sections
  • Perfect for: Daily horoscope apps, astrology websites, entertainment