All posts
agent-docs
AI Meal Planner Agent Skill — Generate Weekly Meal Plans via API
A complete agent skill for generating personalized weekly meal plans using AI Pass API. Supports all major diet types, allergies, and serving sizes.
EiliyaMarch 15, 20262 min read
AI Meal Planner Agent Skill — Generate Weekly Meal Plans via API
This skill enables AI agents to generate complete, personalized meal plans with shopping lists using AI Pass API.
Setup
- Create an AI Pass account: aipass.one — $1 free credit on signup
- Get API key: Developer Dashboard → API Keys
- Set environment:
export AIPASS_API_KEY="your-key"
Python Implementation
import os, requests
AIPASS_API_KEY = os.environ["AIPASS_API_KEY"]
BASE_URL = "https://aipass.one/apikey/v1"
def generate_meal_plan(
diet: str = "balanced",
duration: str = "7-day",
people: str = "2 people",
avoid: str = "",
prefs: str = ""
) -> dict:
"""
Generate a complete meal plan with shopping list.
Returns:
dict with 'plan' and 'shopping_list' keys
"""
headers = {
"Authorization": f"Bearer {AIPASS_API_KEY}",
"Content-Type": "application/json"
}
avoid_line = f"\nFoods to avoid: {avoid}" if avoid else ""
prefs_line = f"\nPreferences: {prefs}" if prefs else ""
plan_prompt = f"""Create a {duration} meal plan for {people}.
Diet type: {diet}{avoid_line}{prefs_line}
Format each day with Breakfast, Lunch, Dinner and brief recipe notes."""
# Generate meal plan
r1 = requests.post(
f"{BASE_URL}/chat/completions",
headers=headers,
json={
"model": "gpt-5-mini",
"temperature": 1,
"max_tokens": 3000,
"messages": [
{"role": "system", "content": "You are a professional nutritionist and meal planning expert."},
{"role": "user", "content": plan_prompt}
]
},
timeout=60
)
plan_text = r1.json()["choices"][0]["message"]["content"]
# Generate shopping list from plan
r2 = requests.post(
f"{BASE_URL}/chat/completions",
headers=headers,
json={
"model": "gpt-5-mini",
"temperature": 1,
"max_tokens": 1500,
"messages": [
{"role": "system", "content": "You create organized grocery shopping lists."},
{"role": "user", "content": f"Create a shopping list for {people} based on:\n\n{plan_text}\n\nOrganize by: Produce, Protein, Dairy/Eggs, Grains/Pantry, Other. Include quantities."}
]
},
timeout=30
)
shopping_text = r2.json()["choices"][0]["message"]["content"]
return {
"plan": plan_text,
"shopping_list": shopping_text
}
# Example
if __name__ == "__main__":
result = generate_meal_plan(
diet="mediterranean",
duration="7-day",
people="2 people",
avoid="No shellfish",
prefs="Love olive oil, fresh herbs, light dinners"
)
print("=== MEAL PLAN ===")
print(result["plan"])
print("\n=== SHOPPING LIST ===")
print(result["shopping_list"])
curl Example
curl -s -X POST https://aipass.one/apikey/v1/chat/completions \
-H "Authorization: Bearer $AIPASS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5-mini",
"temperature": 1,
"max_tokens": 3000,
"messages": [
{"role": "system", "content": "You are a professional nutritionist."},
{"role": "user", "content": "Create a 7-day vegetarian meal plan for 2 people. Include shopping list."}
]
}' | python3 -c "import json,sys; print(json.load(sys.stdin)['choices'][0]['message']['content'])"
Supported Diet Types
| Diet | Description |
|---|---|
balanced |
Mixed omnivore diet |
vegetarian |
No meat or fish |
vegan |
No animal products |
keto |
High fat, very low carb |
mediterranean |
Plant-forward, olive oil, seafood |
high-protein |
30%+ protein macros |
gluten-free |
No wheat, barley, rye |
paleo |
Whole foods, no grains |
Related Resources
For AI agents
Skill file
# AI Meal Planner Skill
## Description
Generate complete weekly meal plans with shopping lists via AI Pass API.
## Auth
Requires AI Pass API key: https://aipass.one/panel/developer.html → API Keys
Authorization: Bearer $AIPASS_API_KEY
## Endpoint
POST https://aipass.one/apikey/v1/chat/completions
## Parameters
- diet: balanced|vegetarian|vegan|keto|mediterranean|high-protein|gluten-free
- duration: 3-day|5-day|7-day
- people: number of servings
- avoid: foods to exclude (optional)
- prefs: additional preferences (optional)
## Response
choices[0].message.content — full meal plan
## Live App
https://aipass.one/apps/meal-planner