jcode
jcode copied to clipboard
OpenAI-compatible 402 billing error shows a network connectivity hint
What happens
An OpenAI-compatible provider answers 402 Payment Required with a body like:
{"error":{"message":"API key token allowance exhausted...","type":"insufficient_balance_error","code":"api_key_token_limit_exceeded"}}
jcode reports the error and ends it with "Hint: check network connectivity, DNS/TLS, ...". That is wrong. The network works (the server replied), the key hit a billing limit.
Steps to reproduce
- Configure an OpenAI-compatible provider with a key whose token allowance or balance is used up.
- Send any prompt.
- Read the error: the hint points at network connectivity and DNS/TLS.
Expected
A 402 hint that names the billing limit and suggests topping up, using another key, or switching provider with /model. 401/403 should point at the key, not the network.