Skip to content

devlog/token-math/two-terminal-tests-that-protect-your-sign-up-credit-73.md

Two Terminal Tests That Protect Your Sign-Up Credit

Test two useful prompts before wiring up an agent

Sign-up credit disappears surprisingly quickly when your first experiment is an agent reading a repository. I start with two small requests from the terminal: one ordinary coding task and one awkward edge case. That gives me something concrete to judge before background tools, conversation history, and automatic retries enter the picture.

Fluxo gives you one key and one base URL, https://api.fluxorelay.com, across its model catalog. Billing follows real token usage, including cache reads and writes, with no monthly fee. That makes small experiments straightforward, but free credit still deserves a spending plan. If you want to follow along, you can create a Fluxo account and use your available sign-up credit for these checks.

1. Choose a spending allowance before sending requests

Check your available credit and the current rates for your chosen model in your account. Write down the starting balance and a small allowance, such as $0.10 or whatever smaller amount fits your credit. This is a manual stopping rule, not an API-enforced spending cap.

For this walkthrough, choose Claude Haiku 4.5 or DeepSeek V4 Flash after comparing their listed rates. Check input, output, and cache pricing separately. A short answer does not make a large input cheap, and cached input can still incur charges.

2. Prepare Bash without putting your key in history

The commands below require Bash, curl, and jq. Use a fresh directory so request files and usage records stay together. The silent prompt keeps the key itself out of your shell history; avoid running this session with shell tracing enabled.

mkdir -p fluxo-credit-test — cd fluxo-credit-test — export FLUXO_BASE_URL='https://api.fluxorelay.com' — read -r -s -p 'Fluxo API key: ' FLUXO_API_KEY

export FLUXO_API_KEY — printf '\n' — Keep the key out of committed configuration files. The saved responses below should contain model output and usage, so inspect them before sharing them.

3. Retrieve the model ID instead of guessing it

Fetch the available model identifiers through the OpenAI-compatible models endpoint. A shelf name is not necessarily the identifier a request expects.

curl --silent --show-error --fail-with-body --max-time 30 "$FLUXO_BASE_URL/v1/models" -H "Authorization: Bearer $FLUXO_API_KEY" -o models.json

jq -r '.data[] | [.id, (.name // "")] | @tsv' models.json

Match your chosen model using the returned metadata or your account’s model information, then paste its exact API identifier at this prompt.

read -r -p 'Exact model ID: ' FLUXO_MODEL

export FLUXO_MODEL

4. Send one bounded coding request

Build a request with a short input and a 128-token output limit. This example uses the OpenAI-compatible chat endpoint. Check the selected model’s parameter requirements if the endpoint rejects the request.

jq -n --arg model "$FLUXO_MODEL" '{model:$model,messages:[{role:"user",content:"Write a Python function first_duplicate(items) that returns the first repeated integer, or None. Return only the function."}],max_tokens:128}' > request.json

curl --silent --show-error --fail-with-body --max-time 60 "$FLUXO_BASE_URL/v1/chat/completions" -H "Authorization: Bearer $FLUXO_API_KEY" -H 'Content-Type: application/json' --data-binary @request.json -o response-1.json

jq '{error, answer:.choices[0].message.content, finish_reason:.choices[0].finish_reason, usage}' response-1.json — Read the function before doing anything else. Does it handle empty input and repeated zero correctly? A length-related finish reason means the output limit may have truncated the answer. The timeout limits your waiting time; it does not guarantee cancellation or prevent billing.

5. Check the balance, then test one edge case

Inspect the usage object and your account’s charge record. Usage fields vary, so preserve the complete object, including any cache or reasoning details returned. Token counts alone are not a dollar total without the applicable rates. Allow for delayed accounting before deciding whether another request fits your allowance.

For the second test, replace the prompt while keeping the same model and output limit.

jq '.messages[0].content = "For first_duplicate(items), give expected results for [], [0,0], and [2,1,1,2]. Explain which duplicate occurs first. Keep the answer brief."' request.json > request-2.json

Repeat the previous curl command with request-2.json and response-2.json as its filenames. Stop after those two requests and compare the answers with the recorded charges.

6. Expand only after the two-request check

Fluxo also works with Claude Code, Codex, Gemini CLI, and OpenAI SDKs. Before connecting one, check its history size, retry behavior, and tool permissions. Keep referral earnings separate from your test budget: Fluxo shares revenue when people you invite pay, but that is not credit already available for this experiment.

Next in the buffer

Sign up in a minute and get credit to try every model mentioned here. Sign up →