Direct Claude API support
I would love to see Direct API added so that ccflare could auto-switch when my Max 20x runs out, but I just have a handful more requests that I'm fine paying for via my API account.
Configuration could include:
- When to switch to API
- Maximum daily, weekly, monthly API cost limit
I use claude a great deal fully automated via the -p argument, this would enable seamless failover for me without requiring implementing credentials swapping across many projects using my Max OAuth.
Ideally it would intercept the "out of tokens" response, resubmit the request via the API, and the claude client would never know.
Currently adding an account as console should let you use your API account.
That said, I've still got to add the ability of adding an API key instead. Will get to it when I have a minute :)
"Maximum daily, weekly, monthly API cost limit"
Good idea. The cost limits for this API is a great (potentially necessary) thing to have.
"When to switch to API"
Other than falling back to API from a rate limited response, are there other cases you imagine?
Other than falling back to API from a rate limited response, are there other cases you imagine?
The API rarely goes down, while CC has frequently. So an option to switch to API in the event the CC endpoint is failing would be a nice option. With continuous monitoring of the CC endpoint to auto-failback to the cheap one :)
Thanks for considering the idea.
Love this! Would be great to also add Bedrock/Vertex into the mix.
Just wanted to add that since sonnet 1M context length is only available in the API would be a game changed to be able to dynamically change provider and use API for important sessions where I need a bit more context before wrapping up.
I tired to add console provider today, but it failed. I get an Authorization Code, but when I paste it in it just doesn't work, tried in the web ui and in terminal no luck I get the error: NOT NULL constraint failed: accounts.refresh_token after submitting the token.