#!/usr/bin/env bash
# Banana Peel — minimal create response (cURL one-pager)
set -euo pipefail

export BANANA_PEEL_BASE="${BANANA_PEEL_BASE:-https://bananapeel.com}"
: "${BANANA_PEEL_API_KEY:?Set BANANA_PEEL_API_KEY=bp_live_…}"

curl -sS "$BANANA_PEEL_BASE/api/v1/responses" \
  -H "Authorization: Bearer $BANANA_PEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "banana-peel",
    "input": "Extract the title from https://example.com",
    "routing": "smart"
  }' | jq .

# Optional — Output normalization (+$0.10 / run):
# curl -sS "$BANANA_PEEL_BASE/api/v1/responses" \
#   -H "Authorization: Bearer $BANANA_PEEL_API_KEY" \
#   -H "Content-Type: application/json" \
#   -d '{
#     "model": "banana-peel",
#     "input": "Extract the latest order from https://example.com/orders",
#     "routing": "smart",
#     "normalize": true,
#     "output_schema": {
#       "type": "object",
#       "properties": {
#         "order_id": { "type": "string" },
#         "total": { "type": "string" }
#       },
#       "required": ["order_id", "total"]
#     }
#   }' | jq .
