What Changes When the OpenAI Python SDK Points at SwiftRelay
The OpenAI Python SDK keeps doing what you already expect: you send a request, you get a response. What changes is where that request goes and how the meter runs. On SwiftRelay, the SDK talks to the OpenAI-compatible endpoint at https://api.fastapirelay.com/v1 with a swft_ key as the API key. The shape of your code stays familiar, while the billing becomes pay-per-token and itemised.
SwiftRelay is a pay-per-token API relay. There is no monthly fee and nothing to subscribe to. You top up a balance, and each call deducts only what it used. That is the change worth understanding before you write a line: your SDK habits stay in place, while your spend follows actual usage instead of a flat recurring charge.
The other half of what stays is visibility. Every call shows up in usage with tokens and cost per call, so you can line a request up against its price instead of guessing at the end of the month. And because SwiftRelay speaks the OpenAI-compatible protocol, the OpenAI Python SDK is right at home with GPT, DeepSeek and the other remaining models.
One more thing stays simple: the account. Sign up, top up, copy three lines, run. SwiftRelay is built around the idea that a relay should be connected in minutes, not buried under setup paperwork.
Three Setup Steps on the OpenAI Python SDK
SwiftRelay's promise is direct: connected in minutes, copy three lines and run. For an OpenAI Python SDK setup, that means three things.
- Point the client at the SwiftRelay API host and OpenAI-compatible base URL.
- Give it a swft_ key as the API key.
- Send your first request and read the tokens and cost per call in the usage list.
Step one and step two look like this in your configuration:
01 base_url='https://api.fastapirelay.com/v1' 02 api_key='<your swft_ key>'
Step three is the request itself: ask the model something, take the answer, then open the dashboard and check the usage list. There you can see the tokens that call consumed and what it cost. That feedback loop is the practical difference between a relay you trust and one you cross-check.
Keys live in your SwiftRelay account, and you can keep up to 20 live API keys per account. That is useful when a developer key, a script key and a service key each need their own slot, and it is useful to know the ceiling while you plan.
Support also lives in the same place. If something needs a question, SwiftRelay handles it through Messages in the dashboard, with login required. There is no support email to hunt for, so the conversation stays attached to the account that generated the request.
The Current Token Prices Behind Every SDK Call
These are the current prices per 1M tokens as shown on the SwiftRelay pricing page, and they are the only numbers used in the sums below.
- DeepSeek V4 Flash (deepseek-v4-flash): input $0.2639, output $1.06, cache read $0.006944.
- DeepSeek V4 Pro (deepseek-v4-pro): input $1.17, output $3.51, cache read $0.0389.
- GPT-6 Astra (gpt-6-astra): input $0.6597, output $3.28, cache read $0.0653.
- GPT-6.1 Sol (gpt-6.1-sol): input $0.1736, output $0.8542, cache read $0.0347.
Read them as three separate meters per call: what you send in, what comes back out, and what is served from cache. Now let us put a single request through them, line by line.
A Line-by-Line Worked Example with GPT-6.1 Sol
Example only: one call to GPT-6.1 Sol with 10,000 input tokens, 2,000 output tokens and 5,000 cache read tokens.
- Input: 10,000 of 1M tokens is 0.01 of the input rate, so 0.01 × $0.1736 = $0.001736.
- Output: 2,000 of 1M tokens is 0.002 of the output rate, so 0.002 × $0.8542 = $0.0017084.
- Cache read: 5,000 of 1M tokens is 0.005 of the cache read rate, so 0.005 × $0.0347 = $0.0001735.
- Total for the call: $0.001736 + $0.0017084 + $0.0001735 = $0.0036179.
That is the whole trick of pay-per-token billing: the bill is the sum of the parts, and the parts are visible. Nothing is rounded away, nothing is bundled into a tier you cannot inspect.
Example two, on the other end of the list. One call to DeepSeek V4 Flash with 100,000 input tokens, 20,000 output tokens and 50,000 cache read tokens.
- Input: 100,000 of 1M tokens is 0.1 of the input rate, so 0.1 × $0.2639 = $0.02639.
- Output: 20,000 of 1M tokens is 0.02 of the output rate, so 0.02 × $1.06 = $0.0212.
- Cache read: 50,000 of 1M tokens is 0.05 of the cache read rate, so 0.05 × $0.006944 = $0.0003472.
- Total for the call: $0.02639 + $0.0212 + $0.0003472 = $0.0479372.
Notice how the cache read line behaves: it carries its own rate, and on both examples it is the smallest of the three. Repeated context you reuse does not have to be paid for at the full input rate. Pick the model that suits the job, then let the usage list confirm the arithmetic.
A Day of SDK Calls, Added Up
Example only: a day of 300 calls that each match the first worked example above.
- 300 × $0.0036179 = $1.08537 for the day.
- On a lighter day of 100 identical calls: 100 × $0.0036179 = $0.36179.
Same code, same model, different volume, and the balance follows the tokens rather than a fixed charge. That is the good-value part of SwiftRelay: a quiet day costs a quiet amount, and a busy day is still fully accounted for line by line.
Top-ups are sized to match. The available amounts are $1.39, $6.94, $13.89, $27.78, $69.44 and $138.89, so you can start small for a test script or fund a working service in one go. New accounts also receive a sign-up gift credit of $0.22, which goes straight toward calls you have not made yet.
There is no monthly fee and nothing to subscribe to, so nothing expires on a schedule you did not choose. You keep a balance, the balance buys tokens, and the tokens buy answers. If you would rather not carry a separate subscription or official account for the same work, per-token billing is the alternative, and SwiftRelay is where you run it.
Credits, Refunds and Rewards You Can Follow
Money in, money out, money back when it should be. SwiftRelay offers a refund of unused credit within 11 days of a top-up, minus what was used and the payment fee. So the rule is simple: top up, use what you need, and the unused portion inside that window is refundable under those terms.
There is also a referral programme built on the same transparent arithmetic. You receive 14% of each top-up by someone you invited, and 3% from the people they invite. Those rewards can be withdrawn once they reach the $4.86 minimum, or moved into your balance to fund the next batch of calls.
Put the pieces together and SwiftRelay looks like a relay designed for people who like to see numbers: a sign-up gift credit of $0.22, top-ups from $1.39 upward, per-call costs in the usage list, refunds on unused credit within 11 days, referral rewards that can become working balance, and up to 20 live API keys per account. The OpenAI Python SDK changes only the address on the envelope; the meter stays in plain sight.
Stopwatch in hand, top up your balance, copy those three lines, and sign up for SwiftRelay today — your first request can be running before the coffee cools.