import requests
import json
import base64

# Generate image using DALL-E via OpenAI
prompt = """Professional blog header image for a Florida medical cannabis website.
Theme: Weed deals and savings in Florida
Style: Clean, modern, green and white color scheme
Elements: Abstract cannabis leaf design, subtle dollar sign or savings imagery, Florida peninsula outline
No text or words
Dimensions: 1200x630 pixels (horizontal)
Vibe: Professional, trustworthy, patient-focused"""

response = requests.post(
    "https://api.openai.com/v1/images/generations",
    headers={
        "Authorization": f"Bearer {open('..../.openai_api_key').read().strip() if False else ''}",
        "Content-Type": "application/json"
    },
    json={
        "model": "dall-e-3",
        "prompt": prompt,
        "n": 1,
        "size": "1792x1024",
        "quality": "standard",
        "response_format": "url"
    },
    timeout=60
)

print(json.dumps(response.json(), indent=2))
