aidar-freeed/ai-codereviewer

Unexpected high bill

Opened this issue · 2 comments

We are a small team of three developers.

OpenAI charged us $62 CAD just in the last three days. Initially, I thought this was caused by some issues with package-lock.json, but JSON files are excluded. How can we resolve this?

here is our config
`name: AI Code Reviewer

on:
pull_request:
types:
- opened
- synchronize
permissions: write-all
jobs:
review:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

  - name: AI Code Reviewer
    uses: our-team/ai-codereviewer@main
    with:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 
      OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
      OPENAI_API_MODEL: 'gpt-4' # Optional: defaults to "gpt-4"
      exclude: '**/*.json, **/*.md' # Optional: exclude patterns separated by commas`
Screenshot 2024-06-25 at 3 29 56 PM

There were only 30 runs in the last 4 days

Thats kinda expected since OpenAI API is very expensive and you're sending lots of diff data