How to check your API wallet balance
Read your remaining TokenRex wallet balance from code.
Call the balance endpoint
Send a GET request with your key to the balance endpoint to monitor spending or alert before you run out.
Example
curl https://tokenrex.ai/api/public/v1/balance -H "Authorization: Bearer YOUR_TOKENREX_KEY"Questions
- Do I need a separate key for each provider?
- No. One TokenRex API key works for every enabled model; change only the model ID.
Related
- How to use the OpenAI SDK with a custom base URL
- How to call Claude with the OpenAI SDK
- How to call Gemini with the OpenAI SDK
- How to use the Anthropic Messages API on TokenRex
- How to stream LLM responses
- How to use function calling (tools) with an LLM API
- How to send images to a vision model
- How to generate images with an API