chatcraft.org
chatcraft.org copied to clipboard
add logic to track credit left
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.