Question
How are AI credits consumed by the JetBrains Junie plugin?
Note: See JetBrains AI Cloud Quota Limits to know what AI credit is and how it works.
Answer
TLDR:
- Token (and AI credit, respectively) usage in Junie is per LLM request (not per prompt).
- When working on the user's task, Junie sends a number of LLM requests to several LLM vendors.
- AI credits are spent only when Junie receives a successful response from the LLM vendor. If an LLM request fails, no AI credits are spent.
Below is a detailed description of how LLM request routing works and at what point your AI credits are spent.
LLM request routing
When working on the user's task, Junie issues a number of LLM requests to several external LLM vendors such as OpenAI, Anthropic, and Google. This includes:
- Requests to the primary LLM selected in the IDE’s settings (Settings | Tools | Junie | Models).
- Requests to an inexpensive LLM (e.g., gpt4.1-mini) for summarization and auxiliary tasks.
- If needed, requests to subtask-specific LLMs.
All requests follow the same route: Junie plugin ↔ JetBrains AI Proxy ↔ LLM vendor.
When are AI credits consumed?
The user's AI credits are consumed when JetBrains AI Proxy receives a successful response from the LLM vendor. That said, a user does not spend AI credits when there’s a timeout or error on the LLM vendor side.
There are, however, some corner cases when a user's AI credits can be consumed without receiving a successful response from the LLM, namely:
- A user-side connection issue occurred after the LLM request had been sent.
- A successful (200 status) LLM response with incorrect content (e.g., LLM trying to call a tool in the wrong way) is received.
What should the user do if an error occurs?
If an error occurs, the user can try to continue with a follow-up prompt: in that case, the initial task's content is saved and reused.
In case facing the errors repeatedly, please contact support via Share feedback at the bottom of the AI Chat tool window (or click the Options icon → Submit Feedback in the Junie tool window).
Comments
0 comments
Please sign in to leave a comment.