FILE_JSON=$(curl --fail-with-body -sS "$SESSION_URL/files" \
-H "X-API-Key: $AGENTSCOPE_API_KEY" -H 'Idempotency-Key: report-file-001' \
-H 'X-File-Name: report.pdf' -H 'Content-Type: application/pdf' \
--data-binary @report.pdf)
FILE_ID=$(printf '%s' "$FILE_JSON" | jq -er '.id')
curl --fail-with-body -sS "$SESSION_URL/turns" \
-H "X-API-Key: $AGENTSCOPE_API_KEY" -H 'Content-Type: application/json' \
-H 'Idempotency-Key: review-report-001' \
-d "$(jq -n --arg id "$FILE_ID" \
'{input:[{role:"user",content:[{type:"text",text:"Review this report"},{type:"file",file_id:$id}]}]}')"