2727
2828 - name : Review
2929 env :
30- LITELLM_API_KEY : ${{ secrets.LITELLM_API_KEY }}
30+ OPENROUTER_API_KEY : ${{ secrets.OPENROUTER_API_KEY }}
31+ OPENROUTER_BASE_URL : ${{ secrets.OPENROUTER_BASE_URL }}
3132 GH_TOKEN : ${{ github.token }}
3233 PR_NUMBER : ${{ github.event.pull_request.number }}
3334 PR_TITLE : ${{ github.event.pull_request.title }}
5051 run : |
5152 set -euo pipefail
5253
53- if [ -z "${LITELLM_API_KEY :-}" ]; then
54- echo "LITELLM_API_KEY not available, skipping review"
54+ if [ -z "${OPENROUTER_API_KEY :-}" ]; then
55+ echo "OPENROUTER_API_KEY not available, skipping review"
5556 exit 0
5657 fi
5758
@@ -62,18 +63,19 @@ jobs:
6263 --arg diff "$DIFF" \
6364 --arg system "$SYSTEM_PROMPT" \
6465 '{
65- model: "llm-gateway /claude-sonnet-4- 6",
66+ model: "anthropic /claude-sonnet-4. 6",
6667 max_tokens: 1024,
6768 messages: [
6869 {role: "system", content: $system},
6970 {role: "user", content: ("PR: " + $title + "\n\nDiff:\n" + $diff)}
7071 ]
7172 }' > /tmp/payload.json
7273
74+ BASE_URL="${OPENROUTER_BASE_URL:-https://openrouter.ai/api/v1}"
7375 RESPONSE=$(curl -sf \
74- -H "Authorization: Bearer ${LITELLM_API_KEY }" \
76+ -H "Authorization: Bearer ${OPENROUTER_API_KEY }" \
7577 -H "Content-Type: application/json" \
76- "https://elastic.litellm-prod.ai/v1 /chat/completions" \
78+ "${BASE_URL%/} /chat/completions" \
7779 -d @/tmp/payload.json)
7880
7981 CONTENT=$(echo "$RESPONSE" | jq -r '.choices[0].message.content // empty')
0 commit comments