Connecting Gemini 2.5 Flash to SwiftRelay in Three Lines
Here is the fast lane. SwiftRelay is a pay-per-token API relay, and the setup pitch is deliberately short: you can be connected in minutes, because you copy three lines and run. There is no monthly fee and nothing to subscribe to. You top up a balance, and each call deducts only what it used. That makes SwiftRelay a comfortable fit for a coding session that starts small, grows through the afternoon, and ends when you close the terminal.
Gemini models speak their own native protocol, and SwiftRelay routes them through Gemini CLI. Grab your swft_ key from the dashboard, paste these lines into your shell, and you are ready:
01 export GOOGLE_GEMINI_BASE_URL=https://api.fastapirelay.com 02 export GEMINI_API_KEY=<your swft_ key>
gemini
That is the whole handshake. No plan to select, no seat to buy, no contract to read. You keep working in Gemini CLI exactly as you normally would, and the balance behind your key does the accounting. If you are coming from a tool that bills you a flat recurring amount whether you use it or not, per-token billing on SwiftRelay simply follows the shape of your actual coding day.
Gemini 2.5 Flash Pricing on the SwiftRelay Pricing Page
Here is the number that matters for this topic, taken straight from the SwiftRelay pricing page. For Gemini 2.5 Flash (gemini-2.5-flash), the price per 1M tokens is:
- Input: $0.1875 per 1M tokens
- Output: $1.50 per 1M tokens
- Cache read: $0.0194 per 1M tokens
Input tokens are what you send: your prompt, the file you paste in, the context the model reads. Output tokens are what comes back: the generated code, the explanation, the patch. Cache reads are the tokens the model can reuse from earlier context, and they carry their own line on the pricing page. Because SwiftRelay bills per token, a short question and a long refactor naturally land in very different places on the meter.
For context on the same pricing page, Gemini 3.1 Pro is listed at $1.35 input, $7.81 output and $0.1347 cache read per 1M tokens, while Gemini 3.8 Flash is listed at $0.9931 input, $4.46 output and $0.0986 cache read per 1M tokens. Gemini 4 Argon is listed at $1.31 input, $6.28 output and $0.0653 cache read per 1M tokens. So when a task calls for heavier reasoning, you can move up the range; when it calls for quick edits and quick answers, Gemini 2.5 Flash keeps the meter light.
A Worked Example: What a Day of Coding Costs
Let us run the stopwatch. The figures below are examples, not averages or promises, and they use the Gemini 2.5 Flash prices above.
Example one: a steady day of small fixes. Suppose you make 200 calls during the day, and each call sends 2,000 input tokens and returns 500 output tokens.
- Input per call: 2,000 tokens is 0.002 of 1M, so 0.002 × $0.1875 = $0.000375
- Output per call: 500 tokens is 0.0005 of 1M, so 0.0005 × $1.50 = $0.00075
- Cost per call: $0.000375 + $0.00075 = $0.001125
- Cost for the day: 200 × $0.001125 = $0.225
Example two: a heavier refactoring day. Suppose you make 500 calls, each sending 4,000 input tokens and returning 1,000 output tokens.
- Input per call: 0.004 × $0.1875 = $0.00075
- Output per call: 0.001 × $1.50 = $0.0015
- Cost per call: $0.00075 + $0.0015 = $0.00225
- Cost for the day: 500 × $0.00225 = $1.125
Read those two examples as a lap time, not a subscription. A day of constant prompting on Gemini 2.5 Flash can land well under a couple of dollars, and the only way to know your own number is to watch the usage list. SwiftRelay lists tokens and cost per call, so you can see exactly which prompt produced which figure instead of guessing at the end of the month. You also start with $0.22 in sign-up gift credit, which is enough to run a good number of short calls before you even top up.
Short Code Samples: A Realistic Gemini CLI Session
Now for the part you actually type. The workflow on SwiftRelay is unchanged Gemini CLI, so the code below is the kind of thing you would ask for in the session and paste into your project.
Sample one: a small utility. Prompt: Write a Python function that slugifies a string.
01 import re
02 def slugify(text):
03 text = text.lower().strip()
04 text = re.sub(r'[^a-z0-9]+', '-', text)
05 return text.strip('-')Sample two: a JavaScript helper. Prompt: Write a JavaScript function that debounces a callback.
function debounce(fn, wait) {
let timer = null;
01 return function (...args) {clearTimeout(timer);
01 timer = setTimeout(() => fn.apply(this, args), wait); 02 }; 03 }
Sample three: a test to run against it. Prompt: Write a pytest test for the slugify function.
01 from module import slugify 02 def test_slugify():
assert slugify('Hello SwiftRelay!') == 'hello-swiftrelay'
Each of these exchanges is one call, and each one is priced by the tokens it consumes. A request with a few hundred tokens of context and a few hundred tokens of reply costs a fraction of a cent at the Gemini 2.5 Flash rates; a request that carries a large file and produces a long patch costs more, because both sides of the exchange grow. The practical habit is simple: keep the prompt focused, let the model do the typing, and check the usage list as you go.
Because Gemini runs through its native protocol in Gemini CLI, you can keep your favourite client habits for the other models on the same SwiftRelay balance and switch between them as the work changes. Your usage list stays in one place, and the cost per call stays visible.
Top Up, Watch Every Call, and Stay in Control
SwiftRelay sells no plans. You top up a balance, and the available amounts are $1.39, $6.94, $13.89, $27.78, $69.44 and $138.89. Start with the smallest amount that fits your day, add more when the day calls for it, and let each call deduct only what it used.
You can run up to 20 live API keys per account, which is enough to keep separate keys for separate projects or machines without juggling extra accounts. Each key still draws from the same balance, and each call still shows up in the usage list with its tokens and cost.
If you want to share the relay with a colleague, the referral rewards are simple: you receive 14% of each top-up by someone you invited, and 3% from the people they invite. Those rewards can be moved into your balance or withdrawn, with a $4.86 minimum for withdrawal.
There is also a straightforward refund rule: unused credit can be refunded within 11 days of a top-up, minus what was used and the payment fee. That keeps a small experimental top-up low risk while you are still finding your rhythm.
Support runs through Messages in the dashboard, so you can reach a human from the same place you top up and read your usage. There is no support email to hunt for. Sign in, open Messages, and ask.
Start Your First Run on SwiftRelay
Copy the three lines, top up a balance, and put Gemini 2.5 Flash to work on your next coding day. With $0.22 in gift credit waiting and per-token billing that only charges for what you use, you can start small, watch every call, and scale up when the sprint demands it. Stopwatch in hand, key in the terminal, first run on the board — sign up for SwiftRelay and get coding.