AI Recipe from Fridge Agent Skill - AI Pass API
AI Recipe from Fridge Agent Skill - AI Pass API
Add recipe generation capabilities to your AI agent. Create delicious recipes from ingredients with AI Pass API.
Quick Start
curl -X POST https://aipass.one/apikey/v1/chat/completions \
-H "Authorization: Bearer $AIPASS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4.1-mini",
"messages": [
{"role": "system", "content": "Generate recipes from ingredients"},
{"role": "user", "content": "What can I make with: eggs, cheese, tomatoes?"}
],
"temperature": 1,
"max_tokens": 16000
}'
Generate Recipes
get_recipes() {
local ingredients="$1"
local dietary="${2:-}"
local meal_type="${3:-}"
curl -s -X POST https://aipass.one/apikey/v1/chat/completions \
-H "Authorization: Bearer $AIPASS_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"model\": \"openai/gpt-4.1-mini\",
\"messages\": [
{
\"role\": \"system\",
\"content\": \"Generate 3-5 creative recipes. Ingredients: $ingredients. ${dietary:+Dietary: $dietary.} ${meal_type:+Meal type: $meal_type.} Provide name, times, ingredients, instructions.\"
},
{
\"role\": \"user\",
\"content\": \"What can I make?\"
}
],
\"temperature\": 1,
\"max_tokens\": 16000
}" | python3 -c "import json,sys; print(json.load(sys.stdin)['choices'][0]['message']['content'])"
}
Python
import requests
class RecipeAgent:
def __init__(self, api_key=None):
self.api_key = api_key or os.environ.get("AIPASS_API_KEY")
self.headers = {
"Authorization": f"Bearer {self.api_key}",
"Content-Type": "application/json"
}
def get_recipes(self, ingredients, dietary="", meal_type=""):
response = requests.post(
"https://aipass.one/apikey/v1/chat/completions",
headers=self.headers,
json={
"model": "openai/gpt-4.1-mini",
"messages": [
{
"role": "system",
"content": f"Generate 3-5 creative recipes. Ingredients: {', '.join(ingredients)}. {dietary and f'Dietary: {dietary}.'} {meal_type and f'Meal type: {meal_type}.'} Provide name, times, ingredients, instructions."
},
{
"role": "user",
"content": "What can I make?"
}
],
"temperature": 1,
"max_tokens": 16000
}
)
return response.json()["choices"][0]["message"]["content"]
agent = RecipeAgent()
print(agent.get_recipes(["chicken", "rice", "broccoli"], "gluten-free", "dinner"))
Cost
~$0.002 per recipe batch