MyRelay

← Back to the notebook

I check the cost before giving Codex a bigger task

Your terminal tool and your AI bill are separate things

Codex CLI is a coding assistant you use from a terminal, the text-based application where developers run tools. It can examine a project, suggest changes, and help carry out coding tasks. The CLI is the tool on your computer; the model answering its requests runs elsewhere.

An endpoint is the address where those requests go. Using a pay-as-you-go endpoint means paying for API usage rather than assuming your coding session is covered by a chat subscription. A subscription to a separate chat product does not automatically pay for requests sent through a relay.

MyRelay provides one personal key and one budget across supported model providers. For a student or individual developer, that makes spending easier to follow without managing a separate balance for every provider.

Connect the provider before starting real work

Begin with the current official Codex CLI installation instructions for your operating system. Once the tool is installed, look for its custom model provider settings. These tell Codex which service to contact, which model to request, and how to authenticate.

Create a MyRelay account, then obtain your API key and check the current Codex connection instructions. MyRelay’s API base is https://api.myapirelay.com. Use the full provider address specified in those instructions, including any required API version suffix, rather than guessing the complete request address.

The model setting needs the exact API identifier shown by the provider, which may differ from a model’s readable menu name. Also check that the selected model supports the API behavior Codex requires. An endpoint being OpenAI-compatible does not mean every model supports every coding tool feature. Codex uses the Responses API, so that support matters.

Follow the documented method for supplying the key, typically through an environment variable that Codex reads. This is a named value available to an application when it starts. Keep the key out of your project, screenshots, and version control. Confirm that Codex is actually using your custom provider rather than another saved sign-in.

A tiny first task makes billing easier to understand

Open a small practice project without passwords, private customer data, or other sensitive material. Ask Codex to explain one short function without changing files. This gives you a low-risk way to check the connection and see a request appear in your usage history.

MyRelay shows each request’s tokens and cost. Tokens are the small pieces of text a model reads and produces. Your question is only part of the input: project content, instructions, and earlier conversation can also contribute. A short request in your terminal can therefore produce a larger bill than its visible length suggests.

If the test fails, read the error before repeating it. Authentication errors suggest checking the key and provider selection. Model or endpoint errors suggest checking the identifier and API compatibility. Repeating an unchanged request is not a useful troubleshooting strategy.

Small assignments are easier to price and review

Once the connection works, give Codex one bounded task, such as explaining a failing test or proposing a change to one function. State what should remain untouched. Review the result before asking it to continue.

A coding session can involve several model requests as the assistant inspects files, uses tools, and evaluates results. Permission prompts help control local actions, but they are not a spending cap. Longer sessions and repeated attempts can keep adding usage.

Choose a personal spending limit before starting, and check costs after the first few tasks. If the service offers enforceable budget controls, configure them separately; do not assume a reminder or visible balance will automatically stop requests at your preferred amount.

Let actual usage decide your next task

After a few small assignments, compare the cost with the help you received. Keep prompts focused, provide relevant files rather than an entire project where possible, and stop an unproductive loop instead of repeatedly asking the same question.

The useful habit is simple: test the connection, inspect the charge, then expand the task gradually. Pay-as-you-go access is easier to manage when each increase in scope is a deliberate choice.

More to read