SwiftRelay

← All sprint notes

Codex CLI Setup on SwiftRelay: What Changes for Beginners

Agent quick startsEN

What Codex CLI changes when you connect it to SwiftRelay

Codex CLI is a coding client that talks to models through an API. When you point it at SwiftRelay, the practical change is straightforward: instead of sending requests to one fixed provider endpoint, you can choose from the models available on SwiftRelay and see the token usage and cost for each call. The workflow itself stays familiar. You still work in the terminal, you still write instructions to Codex CLI, and you still get responses in the same place.

What stays the same is just as important. Codex CLI remains the tool you use for the coding conversation. SwiftRelay does not turn your terminal into a different editor or replace the way Codex CLI handles files, commands and prompts. It provides the API connection behind the client, so the question “what changes?” has a short answer: the endpoint, the API key, the model choice and the billing view.

For a first-time reader, that sounds simple because it is simple. There is no subscription to buy, no recurring access charge and no need to plan around a fixed allowance. You top up a balance, and each call deducts only what it used. New accounts also receive $0.22 in sign-up gift credit, which gives you a small starting balance to explore the connection.

SwiftRelay is built around a quick start: copy three lines and run. That is the part worth remembering when you are deciding whether Codex CLI fits your setup. You are not committing to a new way of working. You are changing the route your existing client uses to reach a model.

Copy three lines and run Codex CLI

The Codex CLI setup on SwiftRelay is short enough to complete before your coffee cools down. You need your swft_ key, the API base URL and the command that starts Codex CLI. The configuration lines are:

01  export OPENAI_BASE_URL=https://api.fastapirelay.com/v1
02  export OPENAI_API_KEY=<your swft_ key>

codex

Run those lines in the terminal where you want to use Codex CLI. The first line tells the client where to send requests. The second line supplies your SwiftRelay key. The third starts the client. There is no separate installation flow described here beyond the Codex CLI you already use.

Once the connection is running, you can select a model that suits the job. The models listed for this setup are GPT-6.1 Sol, GPT-6 Astra, DeepSeek V4 Flash and DeepSeek V4 Pro. Each has a different price and a different balance between input and output pricing, so the sensible approach is to start with one and adjust as you see your actual usage.

For a quick trial, GPT-6.1 Sol has a listed input price of $0.1736 per 1M tokens and an output price of $0.8542 per 1M tokens, with cache reads at $0.0347 per 1M tokens. That makes it a practical first choice when you want to try the connection without overcomplicating the decision.

If you want a different balance between cost and capability, the pricing page gives you the details. DeepSeek V4 Flash is listed at $0.2639 per 1M input tokens, $1.06 per 1M output tokens and $0.006944 per 1M cache-read tokens. DeepSeek V4 Pro is listed at $1.17 per 1M input tokens, $3.51 per 1M output tokens and $0.0389 per 1M cache-read tokens. GPT-6 Astra is listed at $0.6597 per 1M input tokens, $3.28 per 1M output tokens and $0.0653 per 1M cache-read tokens.

Why pay-per-token billing suits a first-time Codex user

The main doubt many new users have is financial: “What if I do not use it enough?” With SwiftRelay, there is no monthly fee and nothing to subscribe to. You top up a balance, and each call deducts only what it used. If your coding work is busy for a day and quiet for the next week, your spending follows that pattern rather than a fixed recurring charge.

That is different from keeping your own subscription or official account, where you may be paying for access whether you use every included unit or not. Per-token billing makes the relationship between activity and cost easier to see. It also lets you begin with a small top-up instead of making a large upfront commitment.

The available top-up amounts are $1.39, $6.94, $13.89, $27.78, $69.44 and $138.89. You choose the amount that matches your comfort level. For a first run, the smaller options are enough to test the three-line setup and confirm that Codex CLI is behaving as you expect. You can add more balance when you have a clearer picture of your daily token use.

Example only: if you use $6.94 of balance across your calls, your balance is reduced by that amount, plus any part of the balance you have not used remains available. Because the deduction is based on what each call used, the useful habit is to check the usage list after a session. SwiftRelay lists tokens and cost per call, so you can see which prompts and responses are shaping your spending.

There is another small benefit to this model: you can compare models by watching the cost of real work rather than guessing from a headline number. A long explanation may produce more output tokens. A large code file may produce more input tokens. The usage view makes those differences visible while they are still small enough to adjust.

Choosing a model without guessing at the price

Model choice is often where first-time users hesitate. The good news is that you do not need to memorise every figure before you begin. Pick a model, run a few representative Codex CLI tasks, and read the token and cost entries afterward. The pricing page provides the reference figures, while the usage list shows what happened in your own session.

GPT-6.1 Sol is the most economical listed GPT option here. Its input price is $0.1736 per 1M tokens, its output price is $0.8542 per 1M tokens and its cache-read price is $0.0347 per 1M tokens. It is a sensible starting point for everyday coding questions, repository exploration and iterative edits.

GPT-6 Astra has higher listed figures: $0.6597 per 1M input tokens, $3.28 per 1M output tokens and $0.0653 per 1M cache-read tokens. If a task calls for a different level of model performance, you can switch and then check the cost of that call instead of assuming the choice is free.

DeepSeek gives you two more options. DeepSeek V4 Flash lists $0.2639 per 1M input tokens, $1.06 per 1M output tokens and $0.006944 per 1M cache-read tokens. DeepSeek V4 Pro lists $1.17 per 1M input tokens, $3.51 per 1M output tokens and $0.0389 per 1M cache-read tokens. The Flash model is the lighter-priced DeepSeek option; the Pro model is the higher-priced one. Your usage history is the right place to decide which fits the work you actually send through Codex CLI.

One practical tip: keep one model selected for a comparison session, then change only the model for the next comparable task. That gives you a clean read on both output and cost, without mixing several variables at once.

Keys, usage and support: the small operational details

SwiftRelay supports up to 20 live API keys per account. For one person using Codex CLI, you may only need one, but the limit means you can keep separate keys for different projects or environments without turning every experiment into a new account. Your key uses the swft_ prefix, and it is the value you place after OPENAI_API_KEY.

Because the key is part of your shell configuration, treat it like any other private credential. Give each project its own key when that helps you track usage, and remove keys you no longer need. The account limit is 20 live keys, so the setup can grow with your workflow rather than forcing you into a single shared arrangement.

Your dashboard is also where the practical controls live. The usage list shows tokens and cost per call. That view is useful after a busy coding session, when you want to know which model produced the largest charges or how much a single task consumed. It is also the quickest way to check that a change in model or configuration has taken effect.

If you need help, support is available through Messages in the dashboard, where login is required. There is no support email to hunt for. Keeping questions, screenshots of the relevant usage entries and your setup details in the message will make the conversation easier to follow.

Refunds are handled on a simple basis: unused credit within 11 days of a top-up can be refunded, minus what was used and the payment fee. Knowing that window before you top up is part of making a low-pressure first decision. Start small, confirm the setup, and let the usage data guide the next step.

What first-time users can expect on the first lap

Here is the frank version. Connecting Codex CLI to SwiftRelay does not add a complicated layer to your coding routine. You copy the three configuration lines, start the client and choose a model. The terminal experience stays where you left it. The new elements are the SwiftRelay balance, the per-call usage view and the choice of listed models.

You do not need to subscribe to anything, and you do not need to predict a month of demand before your first call. Top up an amount you are comfortable trying, use the $0.22 sign-up gift credit, and check the tokens and cost after your first few requests. If a model or top-up size does not suit your pattern, adjust it before the balance becomes a habit.

SwiftRelay also keeps referral rewards in the same straightforward frame. You receive 14% of each top-up by someone you invited, and 3% from the people they invite. Rewards can be withdrawn once they reach the $4.86 minimum, or moved into your balance. Referral activity is therefore another way the balance can grow, not a separate subscription you need to understand.

Ready for a clean first run? Top up SwiftRelay, paste those three lines, and put Codex CLI to work.

Keep reading

Back for another lap?Log in