chatcraft.org icon indicating copy to clipboard operation
chatcraft.org copied to clipboard

add logic to track credit left

Open AnhChienVu opened this issue 4 months ago • 0 comments

Fix #176 Hi, I implemented the logic to track the credit left. However, I couldn't integrate to the click send button. I only made changes in use-cost.tsx file, it's a hook so you can use it at any time. You need to set the API to be able fectch the data from OpenRouter:

const response = await fetch("https://openrouter.ai/api/v1/auth/key", {
        headers: {
          Authorization: `Bearer APIKey`,
        },
      });

It's not a fully integrated feature so just let me know any hints that I can enhance it.

AnhChienVu avatar Oct 04 '24 22:10 AnhChienVu