<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[jliushi]]></title><description><![CDATA[jliushi]]></description><link>https://jliushi.hashnode.dev</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1593680282896/kNC7E8IR4.png</url><title>jliushi</title><link>https://jliushi.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Mon, 19 Oct 2026 06:41:29 GMT</lastBuildDate><atom:link href="https://jliushi.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Sort a Messy Downloads Folder Into Subfolders by File Type with Codex CLI on AgentRouter Free Sign-Up Credit]]></title><description><![CDATA[Your Downloads folder has 800 files: PDFs, installers, screenshots, zips. You want them in folders like Images, Documents and Archives without dragging them by hand. Codex on free sign-up credit can w]]></description><link>https://jliushi.hashnode.dev/sort-a-messy-downloads-folder-into-subfolders-by-file-type-with-codex-cli-on-agentrouter-free-sign-up-credit</link><guid isPermaLink="true">https://jliushi.hashnode.dev/sort-a-messy-downloads-folder-into-subfolders-by-file-type-with-codex-cli-on-agentrouter-free-sign-up-credit</guid><category><![CDATA[codex]]></category><category><![CDATA[Python]]></category><category><![CDATA[automation]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Mon, 19 Oct 2026 05:22:07 GMT</pubDate><content:encoded><![CDATA[<p>Your Downloads folder has 800 files: PDFs, installers, screenshots, zips. You want them in folders like Images, Documents and Archives without dragging them by hand. Codex on free sign-up credit can write the script.</p>
<p><strong>1. Use a relay that supports Codex</strong></p>
<p>On the AI Relay list, AgentRouter is marked for Claude Code and Codex: $100 free sign-up credit at 1x, GitHub account created before 2026. artbloom is Claude Code only.</p>
<p><strong>2. ~/.codex/config.toml</strong></p>
<pre><code>model = "&lt;model ID copied from the relay's list&gt;"
model_provider = "relay"

[model_providers.relay]
name = "relay"
base_url = "https://&lt;relay address&gt;/v1"
env_key = "RELAY_API_KEY"
wire_api = "chat"
</code></pre>
<p><strong>3. Start Codex in an empty project folder</strong></p>
<pre><code>export RELAY_API_KEY="&lt;your relay key&gt;"
mkdir sorter &amp;&amp; cd sorter
codex
</code></pre>
<p><strong>4. The prompt</strong></p>
<pre><code>Write sort_folder.py. Take a folder path as an argument. Move files
(not subfolders) into Images, Documents, Archives, Installers,
Audio, Video and Other based on extension. Never overwrite: if a
name exists, add _1, _2. Default to a dry run that only prints the
moves. Only move files when I pass --apply. Write every move to
moves.log. Use only the standard library.
</code></pre>
<p><strong>5. Dry run first, then apply</strong></p>
<pre><code>python sort_folder.py ~/Downloads
python sort_folder.py ~/Downloads --apply
</code></pre>
<p>Read the dry-run list before you add <code>--apply</code>. If something lands in Other, ask Codex to add that extension to a group.</p>
<p><strong>If Codex errors</strong></p>
<ul>
<li><p>404: check base_url and /v1</p>
</li>
<li><p>401 / 403: wrong key or credit used up</p>
</li>
<li><p>Model not found: copy the exact model ID, same case and hyphens</p>
</li>
</ul>
<p>Relay cards: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Merge a Folder of CSV Files Into One with Codex CLI on AgentRouter Free Sign-Up Credit]]></title><description><![CDATA[You have 30 monthly CSV exports and need one file. Some have the columns in a different order and one has an extra column. Codex on free sign-up credit can write a small script that handles that.
1. U]]></description><link>https://jliushi.hashnode.dev/merge-a-folder-of-csv-files-into-one-with-codex-cli-on-agentrouter-free-sign-up-credit</link><guid isPermaLink="true">https://jliushi.hashnode.dev/merge-a-folder-of-csv-files-into-one-with-codex-cli-on-agentrouter-free-sign-up-credit</guid><category><![CDATA[codex]]></category><category><![CDATA[Python]]></category><category><![CDATA[csv]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Mon, 19 Oct 2026 01:30:08 GMT</pubDate><content:encoded><![CDATA[<p>You have 30 monthly CSV exports and need one file. Some have the columns in a different order and one has an extra column. Codex on free sign-up credit can write a small script that handles that.</p>
<p><strong>1. Use a relay that supports Codex</strong></p>
<p>On the AI Relay list, AgentRouter is marked for Claude Code and Codex: $100 free sign-up credit at 1x, GitHub account created before 2026. artbloom is Claude Code only.</p>
<p><strong>2. ~/.codex/config.toml</strong></p>
<pre><code>model = "&lt;model ID copied from the relay's list&gt;"
model_provider = "relay"

[model_providers.relay]
name = "relay"
base_url = "https://&lt;relay address&gt;/v1"
env_key = "RELAY_API_KEY"
wire_api = "chat"
</code></pre>
<p><strong>3. Start Codex next to your files</strong></p>
<pre><code>export RELAY_API_KEY="&lt;your relay key&gt;"
cd ~/exports
codex
</code></pre>
<p><strong>4. The prompt</strong></p>
<pre><code>Write merge_csvs.py. Read every .csv in a folder given as an
argument. Match columns by header name, not position. Keep the
union of all columns and leave cells empty where a file lacks one.
Add a source_file column. Write merged.csv and print how many rows
came from each file. Do not modify the input files. Use only the
standard library.
</code></pre>
<p><strong>5. Run and check</strong></p>
<pre><code>python merge_csvs.py ~/exports
head -5 merged.csv
</code></pre>
<p>Add up the per-file row counts it prints and compare with the row count of merged.csv. If a file shows garbled text, ask Codex to detect its encoding.</p>
<p><strong>If Codex errors</strong></p>
<ul>
<li><p>404: check base_url and /v1</p>
</li>
<li><p>401 / 403: wrong key or credit used up</p>
</li>
<li><p>Model not found: copy the exact model ID, same case and hyphens</p>
</li>
</ul>
<p>Relay cards: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Find Duplicate Files in a Folder With a Dry Run First, Using Codex CLI on AgentRouter Free Sign-Up Credit]]></title><description><![CDATA[Your Downloads folder has the same PDF saved five times under different names. Codex on free sign-up credit can write a script that finds true duplicates by content and only lists them until you say d]]></description><link>https://jliushi.hashnode.dev/find-duplicate-files-in-a-folder-with-a-dry-run-first-using-codex-cli-on-agentrouter-free-sign-up-credit</link><guid isPermaLink="true">https://jliushi.hashnode.dev/find-duplicate-files-in-a-folder-with-a-dry-run-first-using-codex-cli-on-agentrouter-free-sign-up-credit</guid><category><![CDATA[codex]]></category><category><![CDATA[Python]]></category><category><![CDATA[automation]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Sun, 18 Oct 2026 13:21:11 GMT</pubDate><content:encoded><![CDATA[<p>Your Downloads folder has the same PDF saved five times under different names. Codex on free sign-up credit can write a script that finds true duplicates by content and only lists them until you say delete.</p>
<p><strong>1. Use a relay that supports Codex</strong></p>
<p>On the AI Relay list, AgentRouter is marked for Claude Code and Codex: $100 free sign-up credit at 1x, GitHub account created before 2026. artbloom is Claude Code only.</p>
<p><strong>2. ~/.codex/config.toml</strong></p>
<pre><code>model = "&lt;model ID copied from the relay's list&gt;"
model_provider = "relay"

[model_providers.relay]
name = "relay"
base_url = "https://&lt;relay address&gt;/v1"
env_key = "RELAY_API_KEY"
wire_api = "chat"
</code></pre>
<p><strong>3. Start Codex in a new folder</strong></p>
<pre><code>export RELAY_API_KEY="&lt;your relay key&gt;"
mkdir dupes &amp;&amp; cd dupes
codex
</code></pre>
<p><strong>4. The prompt</strong></p>
<pre><code>Write find_dupes.py. Take a folder path as an argument. Group files
by size first, then by SHA-256 hash, so only files with identical
content count as duplicates. Print each group with full paths and
sizes. By default delete nothing. Add a --move-to option that moves
all but the oldest file in each group into a folder I choose. Never
delete files outright.
</code></pre>
<p><strong>5. Run and check</strong></p>
<pre><code>python find_dupes.py ~/Downloads
python find_dupes.py ~/Downloads --move-to ~/dupes-review
</code></pre>
<p>Look through ~/dupes-review before you empty it. Run the first command on a small test folder before your real one.</p>
<p><strong>If Codex errors</strong></p>
<ul>
<li><p>404: check base_url and /v1</p>
</li>
<li><p>401 / 403: wrong key or credit used up</p>
</li>
<li><p>Model not found: copy the exact model ID, same case and hyphens</p>
</li>
</ul>
<p>Relay cards: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Batch Resize a Folder of Photos Into Thumbnails with Codex CLI on AgentRouter Free Sign-Up Credit]]></title><description><![CDATA[You have a folder of big phone photos and need small copies for a website or a chat. Codex on free sign-up credit can write a short Pillow script that makes thumbnails and never touches the originals.]]></description><link>https://jliushi.hashnode.dev/batch-resize-a-folder-of-photos-into-thumbnails-with-codex-cli-on-agentrouter-free-sign-up-credit</link><guid isPermaLink="true">https://jliushi.hashnode.dev/batch-resize-a-folder-of-photos-into-thumbnails-with-codex-cli-on-agentrouter-free-sign-up-credit</guid><category><![CDATA[codex]]></category><category><![CDATA[Python]]></category><category><![CDATA[pillow]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Sun, 18 Oct 2026 09:28:59 GMT</pubDate><content:encoded><![CDATA[<p>You have a folder of big phone photos and need small copies for a website or a chat. Codex on free sign-up credit can write a short Pillow script that makes thumbnails and never touches the originals.</p>
<p><strong>1. Use a relay that supports Codex</strong></p>
<p>On the AI Relay list, AgentRouter is marked for Claude Code and Codex: $100 free sign-up credit at 1x, GitHub account created before 2026. artbloom is Claude Code only.</p>
<p><strong>2. ~/.codex/config.toml</strong></p>
<pre><code>model = "&lt;model ID copied from the relay's list&gt;"
model_provider = "relay"

[model_providers.relay]
name = "relay"
base_url = "https://&lt;relay address&gt;/v1"
env_key = "RELAY_API_KEY"
wire_api = "chat"
</code></pre>
<p><strong>3. Set up the folder</strong></p>
<pre><code>export RELAY_API_KEY="&lt;your relay key&gt;"
mkdir thumbs &amp;&amp; cd thumbs
cp -r ~/Pictures/trip ./photos
python -m venv .venv &amp;&amp; source .venv/bin/activate
pip install pillow
codex
</code></pre>
<p><strong>4. The prompt</strong></p>
<pre><code>Write make_thumbs.py. For every .jpg, .jpeg and .png in ./photos,
save a copy into ./thumbs that fits inside 400x400 and keeps the
aspect ratio. Respect the EXIF rotation so phone photos are not
sideways. Keep the same file name. Skip files that already exist
in ./thumbs. Never modify anything in ./photos. Print a count at
the end.
</code></pre>
<p><strong>5. Run and check</strong></p>
<pre><code>python make_thumbs.py
ls thumbs | wc -l
ls photos | wc -l
</code></pre>
<p>Open a few thumbs to make sure none are rotated. Want a different size? Ask Codex to add a <code>--size</code> option.</p>
<p><strong>If Codex errors</strong></p>
<ul>
<li><p>404: check base_url and /v1</p>
</li>
<li><p>401 / 403: wrong key or credit used up</p>
</li>
<li><p>Model not found: copy the exact model ID, same case and hyphens</p>
</li>
</ul>
<p>Relay cards: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Clean a Messy Excel Sheet Into a Tidy CSV with Codex CLI on AgentRouter Free Sign-Up Credit]]></title><description><![CDATA[Someone sent you an Excel file with blank rows, merged headers and dates in three formats. Codex on free sign-up credit can write a pandas script that turns it into a clean CSV you can reuse next time]]></description><link>https://jliushi.hashnode.dev/clean-a-messy-excel-sheet-into-a-tidy-csv-with-codex-cli-on-agentrouter-free-sign-up-credit</link><guid isPermaLink="true">https://jliushi.hashnode.dev/clean-a-messy-excel-sheet-into-a-tidy-csv-with-codex-cli-on-agentrouter-free-sign-up-credit</guid><category><![CDATA[codex]]></category><category><![CDATA[Python]]></category><category><![CDATA[pandas]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Sun, 18 Oct 2026 05:28:06 GMT</pubDate><content:encoded><![CDATA[<p>Someone sent you an Excel file with blank rows, merged headers and dates in three formats. Codex on free sign-up credit can write a pandas script that turns it into a clean CSV you can reuse next time.</p>
<p><strong>1. Use a relay that supports Codex</strong></p>
<p>On the AI Relay list, AgentRouter is marked for Claude Code and Codex: $100 free sign-up credit at 1x, GitHub account created before 2026. artbloom is Claude Code only.</p>
<p><strong>2. ~/.codex/config.toml</strong></p>
<pre><code>model = "&lt;model ID copied from the relay's list&gt;"
model_provider = "relay"

[model_providers.relay]
name = "relay"
base_url = "https://&lt;relay address&gt;/v1"
env_key = "RELAY_API_KEY"
wire_api = "chat"
</code></pre>
<p><strong>3. Set up the folder</strong></p>
<pre><code>export RELAY_API_KEY="&lt;your relay key&gt;"
mkdir excel-clean &amp;&amp; cd excel-clean
cp ~/Downloads/report.xlsx .
python -m venv .venv &amp;&amp; source .venv/bin/activate
pip install pandas openpyxl
codex
</code></pre>
<p><strong>4. The prompt</strong></p>
<pre><code>Read report.xlsx (first sheet) with pandas. First print the first
15 rows and the column names so we can see the mess.
Then write clean.py that: finds the real header row, drops fully
empty rows and columns, strips spaces from text, parses the Date
column into YYYY-MM-DD, and writes clean.csv.
Never overwrite report.xlsx.
</code></pre>
<p><strong>5. Run and check</strong></p>
<pre><code>python clean.py
head clean.csv
</code></pre>
<p>Compare the row count with the sheet. Next month, drop the new file in and run <code>python clean.py</code> again.</p>
<p><strong>If Codex errors</strong></p>
<ul>
<li><p>404: check base_url and /v1</p>
</li>
<li><p>401 / 403: wrong key or credit used up</p>
</li>
<li><p>Model not found: copy the exact model ID, same case and hyphens</p>
</li>
</ul>
<p>Relay cards: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Build a Small FastAPI Endpoint with Codex CLI on AgentRouter Free Sign-Up Credit]]></title><description><![CDATA[You have a Python function and want other apps to call it over HTTP. FastAPI makes that a few lines, and Codex on free sign-up credit can write them with a test.
1. Use a relay that supports Codex
On ]]></description><link>https://jliushi.hashnode.dev/build-a-small-fastapi-endpoint-with-codex-cli-on-agentrouter-free-sign-up-credit</link><guid isPermaLink="true">https://jliushi.hashnode.dev/build-a-small-fastapi-endpoint-with-codex-cli-on-agentrouter-free-sign-up-credit</guid><category><![CDATA[FastAPI]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[Python]]></category><category><![CDATA[codex]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Sun, 18 Oct 2026 01:29:11 GMT</pubDate><content:encoded><![CDATA[<p>You have a Python function and want other apps to call it over HTTP. FastAPI makes that a few lines, and Codex on free sign-up credit can write them with a test.</p>
<p><strong>1. Use a relay that supports Codex</strong></p>
<p>On the AI Relay list, AgentRouter is marked for Claude Code and Codex: $100 free sign-up credit at 1x, GitHub account created before 2026. artbloom is Claude Code only.</p>
<p><strong>2. ~/.codex/config.toml</strong></p>
<pre><code>model = "&lt;model ID copied from the relay's list&gt;"
model_provider = "relay"

[model_providers.relay]
name = "relay"
base_url = "https://&lt;relay address&gt;/v1"
env_key = "RELAY_API_KEY"
wire_api = "chat"
</code></pre>
<p><strong>3. Export the key and start</strong></p>
<pre><code>export RELAY_API_KEY="&lt;your relay key&gt;"
mkdir tiny-api &amp;&amp; cd tiny-api
git init
codex
</code></pre>
<p><strong>4. The prompt</strong></p>
<pre><code>Create a FastAPI app in main.py with one endpoint:
POST /slug takes {"text": "..."} and returns {"slug": "..."}
(lowercase, spaces to dashes, strip other symbols).
Return 422 if text is empty.
Add test_main.py using fastapi.testclient and pytest.
Add requirements.txt with fastapi, uvicorn, httpx, pytest.
</code></pre>
<p><strong>5. Run it</strong></p>
<pre><code>pip install -r requirements.txt
pytest
uvicorn main:app --reload
</code></pre>
<p>Open <a href="http://127.0.0.1:8000/docs">http://127.0.0.1:8000/docs</a> and try the endpoint from the page.</p>
<p><strong>If Codex errors</strong></p>
<ul>
<li><p>404: check base_url and /v1</p>
</li>
<li><p>401 / 403: wrong key or credit used up</p>
</li>
<li><p>Model not found: copy the exact model ID, same case and hyphens</p>
</li>
</ul>
<p>Relay cards: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Add Retry With Backoff to Flaky HTTP Requests with Codex CLI on AgentRouter Free Sign-Up Credit]]></title><description><![CDATA[Your script calls an API and sometimes dies on a timeout or a 503. Adding retries with a growing wait fixes most of these. Codex on free sign-up credit can add it in one pass.
1. Use a relay that supp]]></description><link>https://jliushi.hashnode.dev/add-retry-with-backoff-to-flaky-http-requests-with-codex-cli-on-agentrouter-free-sign-up-credit</link><guid isPermaLink="true">https://jliushi.hashnode.dev/add-retry-with-backoff-to-flaky-http-requests-with-codex-cli-on-agentrouter-free-sign-up-credit</guid><category><![CDATA[codex]]></category><category><![CDATA[Python]]></category><category><![CDATA[Requests]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Sat, 17 Oct 2026 13:25:18 GMT</pubDate><content:encoded><![CDATA[<p>Your script calls an API and sometimes dies on a timeout or a 503. Adding retries with a growing wait fixes most of these. Codex on free sign-up credit can add it in one pass.</p>
<p><strong>1. Use a relay that supports Codex</strong></p>
<p>On the AI Relay list, AgentRouter is marked for Claude Code and Codex: $100 free sign-up credit at 1x, GitHub account created before 2026. artbloom is Claude Code only.</p>
<p><strong>2. ~/.codex/config.toml</strong></p>
<pre><code>model = "&lt;model ID copied from the relay's list&gt;"
model_provider = "relay"

[model_providers.relay]
name = "relay"
base_url = "https://&lt;relay address&gt;/v1"
env_key = "RELAY_API_KEY"
wire_api = "chat"
</code></pre>
<p><strong>3. Export the key and start</strong></p>
<pre><code>export RELAY_API_KEY="&lt;your relay key&gt;"
cd my-script
git add -A &amp;&amp; git commit -m "before retries"
codex
</code></pre>
<p><strong>4. The prompt</strong></p>
<pre><code>Add a fetch_with_retry(url, **kwargs) helper in http_utils.py using requests.
Retry up to 4 times on timeouts, connection errors, 429 and 5xx.
Wait 1, 2, 4, 8 seconds between tries. Respect Retry-After if present.
Do not retry other 4xx errors.
Replace the requests.get calls in main.py with it. No other changes.
</code></pre>
<p><strong>5. Check it</strong></p>
<pre><code>git diff
python main.py
</code></pre>
<ul>
<li><p>There is a timeout on every request</p>
</li>
<li><p>A 404 fails right away instead of waiting</p>
</li>
</ul>
<p><strong>If Codex errors</strong></p>
<ul>
<li><p>404: check base_url and /v1</p>
</li>
<li><p>401 / 403: wrong key or credit used up</p>
</li>
<li><p>Model not found: copy the exact model ID, same case and hyphens</p>
</li>
</ul>
<p>Relay cards: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Add SQLite Storage to a Small Python Script with Codex CLI on AgentRouter Free Sign-Up Credit]]></title><description><![CDATA[Your script saves results to a text file and you want real queries. Python ships with sqlite3, so no server is needed. Codex on free sign-up credit can wire it up.
1. Use a relay that supports Codex
O]]></description><link>https://jliushi.hashnode.dev/add-sqlite-storage-to-a-small-python-script-with-codex-cli-on-agentrouter-free-sign-up-credit</link><guid isPermaLink="true">https://jliushi.hashnode.dev/add-sqlite-storage-to-a-small-python-script-with-codex-cli-on-agentrouter-free-sign-up-credit</guid><category><![CDATA[codex]]></category><category><![CDATA[Python]]></category><category><![CDATA[SQLite]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Sat, 17 Oct 2026 09:27:45 GMT</pubDate><content:encoded><![CDATA[<p>Your script saves results to a text file and you want real queries. Python ships with sqlite3, so no server is needed. Codex on free sign-up credit can wire it up.</p>
<p><strong>1. Use a relay that supports Codex</strong></p>
<p>On the AI Relay list, AgentRouter is marked for Claude Code and Codex: $100 free sign-up credit at 1x, GitHub account created before 2026. artbloom is Claude Code only.</p>
<p><strong>2. ~/.codex/config.toml</strong></p>
<pre><code>model = "&lt;model ID copied from the relay's list&gt;"
model_provider = "relay"

[model_providers.relay]
name = "relay"
base_url = "https://&lt;relay address&gt;/v1"
env_key = "RELAY_API_KEY"
wire_api = "chat"
</code></pre>
<p><strong>3. Export the key and start</strong></p>
<pre><code>export RELAY_API_KEY="&lt;your relay key&gt;"
cd my-script
git add -A &amp;&amp; git commit -m "before sqlite"
codex
</code></pre>
<p><strong>4. The prompt</strong></p>
<pre><code>Add a db.py using sqlite3 from the standard library.
Create a table results(id, created_at, value) if it does not exist.
Add save_result(value) and latest(n=10).
Change main.py to call save_result instead of writing results.txt.
Use parameterized queries. No other changes.
</code></pre>
<p><strong>5. Check it</strong></p>
<pre><code>python main.py
sqlite3 data.db "select * from results order by id desc limit 5;"
</code></pre>
<ul>
<li><p>Queries use ? placeholders, not f-strings</p>
</li>
<li><p>data.db is in .gitignore</p>
</li>
</ul>
<p><strong>If Codex errors</strong></p>
<ul>
<li><p>404: check base_url and /v1</p>
</li>
<li><p>401 / 403: wrong key or credit used up</p>
</li>
<li><p>Model not found: copy the exact model ID, same case and hyphens</p>
</li>
</ul>
<p>Relay cards: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Write a Simple Rate Limiter Decorator with Codex CLI on AgentRouter Free Sign-Up Credit]]></title><description><![CDATA[You have an API client that gets 429s. A tiny rate-limit decorator helps. Codex on free sign-up credit can write it.
1. Use a relay that supports Codex
On the AI Relay list, AgentRouter is marked for ]]></description><link>https://jliushi.hashnode.dev/write-a-simple-rate-limiter-decorator-with-codex-cli-on-agentrouter-free-sign-up-credit</link><guid isPermaLink="true">https://jliushi.hashnode.dev/write-a-simple-rate-limiter-decorator-with-codex-cli-on-agentrouter-free-sign-up-credit</guid><category><![CDATA[codex]]></category><category><![CDATA[Python]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Sat, 17 Oct 2026 05:29:57 GMT</pubDate><content:encoded><![CDATA[<p>You have an API client that gets 429s. A tiny rate-limit decorator helps. Codex on free sign-up credit can write it.</p>
<p><strong>1. Use a relay that supports Codex</strong></p>
<p>On the AI Relay list, AgentRouter is marked for Claude Code and Codex: $100 free sign-up credit at 1x, GitHub account created before 2026. artbloom is Claude Code only.</p>
<p><strong>2. ~/.codex/config.toml</strong></p>
<pre><code>model = "&lt;model ID copied from the relay's list&gt;"
model_provider = "relay"

[model_providers.relay]
name = "relay"
base_url = "https://&lt;relay address&gt;/v1"
env_key = "RELAY_API_KEY"
wire_api = "chat"
</code></pre>
<p><strong>3. Export the key and start</strong></p>
<pre><code>export RELAY_API_KEY="&lt;your relay key&gt;"
cd my-repo
codex
</code></pre>
<p><strong>4. The prompt</strong></p>
<pre><code>Create rate_limit.py with a decorator @rate_limit(calls=5, per_seconds=1).
If the limit is hit, sleep until the next window.
Use only the standard library. Add a short docstring. Nothing else.
</code></pre>
<p><strong>5. Check before you commit</strong></p>
<ul>
<li><p>No network calls inside the decorator itself</p>
</li>
<li><p>No keys written into the file</p>
</li>
<li><p>Import it and call a dummy function in a loop to confirm it paces</p>
</li>
</ul>
<p><strong>If Codex errors</strong></p>
<ul>
<li><p>404: check base_url and /v1</p>
</li>
<li><p>401 / 403: wrong key or credit used up</p>
</li>
<li><p>Model not found: copy the exact model ID, same case and hyphens</p>
</li>
</ul>
<p>Relay cards: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Write a GitHub Actions Test Workflow with Codex CLI on AgentRouter Free Sign-Up Credit]]></title><description><![CDATA[You have a Python repo with tests. You want them to run on every push. Codex on free sign-up credit can write the workflow file.
1. Use a relay that supports Codex
On the AI Relay list, AgentRouter is]]></description><link>https://jliushi.hashnode.dev/write-a-github-actions-test-workflow-with-codex-cli-on-agentrouter-free-sign-up-credit</link><guid isPermaLink="true">https://jliushi.hashnode.dev/write-a-github-actions-test-workflow-with-codex-cli-on-agentrouter-free-sign-up-credit</guid><category><![CDATA[codex]]></category><category><![CDATA[github-actions]]></category><category><![CDATA[Python]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Sat, 17 Oct 2026 01:23:31 GMT</pubDate><content:encoded><![CDATA[<p>You have a Python repo with tests. You want them to run on every push. Codex on free sign-up credit can write the workflow file.</p>
<p><strong>1. Use a relay that supports Codex</strong></p>
<p>On the AI Relay list, AgentRouter is marked for Claude Code and Codex: $100 free sign-up credit at 1x, GitHub account created before 2026. artbloom is Claude Code only.</p>
<p><strong>2. ~/.codex/config.toml</strong></p>
<pre><code>model = "&lt;model ID copied from the relay's list&gt;"
model_provider = "relay"

[model_providers.relay]
name = "relay"
base_url = "https://&lt;relay address&gt;/v1"
env_key = "RELAY_API_KEY"
wire_api = "chat"
</code></pre>
<p><strong>3. Export the key and start</strong></p>
<pre><code>export RELAY_API_KEY="&lt;your relay key&gt;"
cd my-repo
codex
</code></pre>
<p><strong>4. The prompt</strong></p>
<pre><code>Create .github/workflows/test.yml.
Run on push and pull_request.
ubuntu-latest, Python 3.12.
pip install -r requirements.txt, then run pytest.
Nothing else.
</code></pre>
<p><strong>5. Check before you push</strong></p>
<ul>
<li><p>File path is exactly .github/workflows/test.yml</p>
</li>
<li><p>No keys or tokens written into the YAML</p>
</li>
<li><p>Then commit, push, and open the Actions tab on GitHub</p>
</li>
</ul>
<p><strong>If Codex errors</strong></p>
<ul>
<li><p>404: check base_url and /v1</p>
</li>
<li><p>401 / 403: wrong key or credit used up</p>
</li>
<li><p>Model not found: copy the exact model ID, same case and hyphens</p>
</li>
</ul>
<p>Relay cards: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Write a Dockerfile for a Small Python App with Codex on AgentRouter Free Sign-Up Credit]]></title><description><![CDATA[You have a small Python app. You want a Dockerfile. Codex on free sign-up credit can draft one you can open and edit.
1. Use a relay that supports Codex
On the AI Relay list, AgentRouter is marked for]]></description><link>https://jliushi.hashnode.dev/write-a-dockerfile-for-a-small-python-app-with-codex-on-agentrouter-free-sign-up-credit</link><guid isPermaLink="true">https://jliushi.hashnode.dev/write-a-dockerfile-for-a-small-python-app-with-codex-on-agentrouter-free-sign-up-credit</guid><category><![CDATA[codex]]></category><category><![CDATA[Docker]]></category><category><![CDATA[Python]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Fri, 16 Oct 2026 13:28:04 GMT</pubDate><content:encoded><![CDATA[<p>You have a small Python app. You want a Dockerfile. Codex on free sign-up credit can draft one you can open and edit.</p>
<p><strong>1. Use a relay that supports Codex</strong></p>
<p>On the AI Relay list, AgentRouter is marked for Claude Code and Codex: $100 free sign-up credit at 1x, GitHub account created before 2026. artbloom is Claude Code only — skip it for this.</p>
<p><strong>2. ~/.codex/config.toml</strong></p>
<pre><code>model = "&lt;model ID copied from the relay's list&gt;"
model_provider = "relay"

[model_providers.relay]
name = "relay"
base_url = "https://&lt;relay address&gt;/v1"
env_key = "RELAY_API_KEY"
wire_api = "chat"
</code></pre>
<p><strong>3. Export the key and start</strong></p>
<pre><code>export RELAY_API_KEY="&lt;your relay key&gt;"
cd my-app
codex
</code></pre>
<p><strong>4. The prompt</strong></p>
<pre><code>Write a Dockerfile for this Python app.
Use python:3.12-slim.
Copy requirements.txt, install deps, then copy the app.
EXPOSE 8000. CMD runs python app.py.
No multi-stage build. Keep it short.
</code></pre>
<p><strong>5. Review before you build</strong></p>
<ul>
<li><p>No secrets baked into the image</p>
</li>
<li><p>COPY paths match your real files</p>
</li>
<li><p>Then: docker build -t my-app .</p>
</li>
</ul>
<p><strong>If Codex errors</strong></p>
<ul>
<li><p>404: check base_url and /v1</p>
</li>
<li><p>401 / 403: wrong key or credit used up</p>
</li>
<li><p>429: wait or switch relays</p>
</li>
</ul>
<p>Relay cards: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Fix a Python Error From Its Traceback with Claude Code on Free Sign-Up Credit]]></title><description><![CDATA[Your script crashes and the traceback means nothing to you. Paste it into Claude Code and let it fix one thing at a time. A relay's free sign-up credit is enough for this.
1. Get a key
Pick a relay fr]]></description><link>https://jliushi.hashnode.dev/fix-a-python-error-from-its-traceback-with-claude-code-on-free-sign-up-credit</link><guid isPermaLink="true">https://jliushi.hashnode.dev/fix-a-python-error-from-its-traceback-with-claude-code-on-free-sign-up-credit</guid><category><![CDATA[claude-code]]></category><category><![CDATA[Python]]></category><category><![CDATA[debugging]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Fri, 16 Oct 2026 09:21:43 GMT</pubDate><content:encoded><![CDATA[<p>Your script crashes and the traceback means nothing to you. Paste it into Claude Code and let it fix one thing at a time. A relay's free sign-up credit is enough for this.</p>
<p><strong>1. Get a key</strong></p>
<p>Pick a relay from the list. artbloom has no special sign-up rules. Create a token in the dashboard and copy the Base URL.</p>
<p><strong>2. Set two variables</strong></p>
<pre><code>export ANTHROPIC_BASE_URL="https://&lt;relay address&gt;"
export ANTHROPIC_AUTH_TOKEN="&lt;your relay key&gt;"
</code></pre>
<p><strong>3. Save your work, then start</strong></p>
<pre><code>cd my-script
git init 2&gt;/dev/null; git add -A &amp;&amp; git commit -m "before fix"
claude
</code></pre>
<p><strong>4. Paste the full error</strong></p>
<pre><code>Running python app.py gives this error:
&lt;paste the whole traceback&gt;
Tell me the cause in two sentences, then fix only that.
</code></pre>
<p>Paste the whole traceback, not just the last line. The file name and line number matter.</p>
<p><strong>5. Run it again</strong></p>
<pre><code>git diff
python app.py
</code></pre>
<p>New error? Paste that one. Same error? Say so and add what you tried.</p>
<p><strong>Keep the credit</strong></p>
<ul>
<li><p>One error per message.</p>
</li>
<li><p>Start a new session when the chat gets long.</p>
</li>
<li><p>Don't paste real passwords, keys or customer data. The relay sees everything you send.</p>
</li>
</ul>
<p>Relays with free sign-up credit: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Write a Folder Backup Script with Codex CLI on Free Sign-Up Credit]]></title><description><![CDATA[A practical first Codex task: a bash script that zips a folder into a dated backup file. Run it on a relay's free sign-up credit.
1. Pick a relay that works with Codex
On the AI Relay list, AgentRoute]]></description><link>https://jliushi.hashnode.dev/write-a-folder-backup-script-with-codex-cli-on-free-sign-up-credit</link><guid isPermaLink="true">https://jliushi.hashnode.dev/write-a-folder-backup-script-with-codex-cli-on-free-sign-up-credit</guid><category><![CDATA[codex]]></category><category><![CDATA[Bash]]></category><category><![CDATA[AI]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Fri, 16 Oct 2026 05:28:36 GMT</pubDate><content:encoded><![CDATA[<p>A practical first Codex task: a bash script that zips a folder into a dated backup file. Run it on a relay's free sign-up credit.</p>
<p><strong>1. Pick a relay that works with Codex</strong></p>
<p>On the AI Relay list, AgentRouter's card says Claude Code and Codex both work: $100 free sign-up credit at 1x, GitHub account from before 2026. Create a token after you log in.</p>
<p><strong>2. ~/.codex/config.toml</strong></p>
<pre><code>model = "&lt;model name copied from the relay's list&gt;"
model_provider = "relay"

[model_providers.relay]
name = "relay"
base_url = "https://&lt;relay address&gt;/v1"
env_key = "RELAY_API_KEY"
wire_api = "chat"
</code></pre>
<p><strong>3. Export the key and start</strong></p>
<pre><code>export RELAY_API_KEY="&lt;your relay key&gt;"
mkdir backup-tool &amp;&amp; cd backup-tool
codex
</code></pre>
<p><strong>4. The prompt</strong></p>
<pre><code>Write backup.sh. Take a folder path as the first argument,
zip it to ~/backups/&lt;foldername&gt;-YYYY-MM-DD.zip,
create ~/backups if missing, and print the output path.
Exit with an error message if the folder doesn't exist.
</code></pre>
<p><strong>5. Test it on something harmless</strong></p>
<pre><code>chmod +x backup.sh
mkdir -p /tmp/demo &amp;&amp; echo hi &gt; /tmp/demo/a.txt
./backup.sh /tmp/demo
</code></pre>
<p>Read the script before you point it at real folders.</p>
<p><strong>Next small asks</strong></p>
<ul>
<li><p>"Keep only the 7 newest backups."</p>
</li>
<li><p>"Add a --dry-run flag."</p>
</li>
</ul>
<p><strong>If Codex errors</strong></p>
<ul>
<li><p>404: base_url is missing /v1</p>
</li>
<li><p>401: key not exported, incomplete, or credit used up</p>
</li>
<li><p>429: rate limit. Wait or switch relays.</p>
</li>
</ul>
<p>Card details and config notes: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Build a CSV-to-JSON Converter with Codex CLI on AgentRouter Free Sign-Up Credit]]></title><description><![CDATA[A small first project for Codex CLI: a script that turns a CSV file into JSON. AgentRouter is the card on the AI Relay list marked for both Claude Code and Codex, with $100 free sign-up credit at 1x.
]]></description><link>https://jliushi.hashnode.dev/build-a-csv-to-json-converter-with-codex-cli-on-agentrouter-free-sign-up-credit</link><guid isPermaLink="true">https://jliushi.hashnode.dev/build-a-csv-to-json-converter-with-codex-cli-on-agentrouter-free-sign-up-credit</guid><category><![CDATA[codex]]></category><category><![CDATA[Python]]></category><category><![CDATA[AI]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Fri, 16 Oct 2026 01:24:49 GMT</pubDate><content:encoded><![CDATA[<p>A small first project for Codex CLI: a script that turns a CSV file into JSON. AgentRouter is the card on the AI Relay list marked for both Claude Code and Codex, with $100 free sign-up credit at 1x.</p>
<p><strong>1. Register and get a key</strong></p>
<p>AgentRouter signs up with GitHub, and the account must be from before 2026. Balance shows $0? Log out and log back in. Then create a token.</p>
<p><strong>2. ~/.codex/config.toml</strong></p>
<pre><code>model = "&lt;model name copied from AgentRouter's list&gt;"
model_provider = "relay"

[model_providers.relay]
name = "relay"
base_url = "https://&lt;relay address&gt;/v1"
env_key = "RELAY_API_KEY"
wire_api = "chat"
</code></pre>
<p>Copy the model string exactly. Don't change case or hyphens.</p>
<p><strong>3. Export the key and start</strong></p>
<pre><code>export RELAY_API_KEY="&lt;your relay key&gt;"
mkdir csv2json &amp;&amp; cd csv2json
codex
</code></pre>
<p><strong>4. The prompt</strong></p>
<pre><code>Write csv2json.py. Read a CSV path from the command line,
use the first row as keys, print JSON to stdout.
Standard library only. Add a sample data.csv with 3 rows.
</code></pre>
<p><strong>5. Try it</strong></p>
<pre><code>python3 csv2json.py data.csv
</code></pre>
<p>Next small ask: "Add an -o option to write to a file." One feature per prompt keeps the credit going further.</p>
<p><strong>If it errors</strong></p>
<ul>
<li><p>404: check the /v1 at the end of base_url</p>
</li>
<li><p>401: key incomplete or credit used up</p>
</li>
<li><p>429: the site is rate limiting. Wait or switch sites.</p>
</li>
</ul>
<p>Full card and setup notes: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Claude Code on WSL: Put Relay Env Vars in the Linux Shell, Not Windows]]></title><description><![CDATA[WSL runs Claude Code inside Linux. Relay env vars set in Windows PowerShell never reach that process.
1. Open a WSL terminal
Ubuntu (or your distro) from Windows Terminal — not PowerShell alone.
2. Se]]></description><link>https://jliushi.hashnode.dev/claude-code-on-wsl-put-relay-env-vars-in-the-linux-shell-not-windows</link><guid isPermaLink="true">https://jliushi.hashnode.dev/claude-code-on-wsl-put-relay-env-vars-in-the-linux-shell-not-windows</guid><category><![CDATA[claude-code]]></category><category><![CDATA[WSL]]></category><category><![CDATA[ai-relay]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Thu, 15 Oct 2026 13:34:47 GMT</pubDate><content:encoded><![CDATA[<p>WSL runs Claude Code inside Linux. Relay env vars set in Windows PowerShell never reach that process.</p>
<p><strong>1. Open a WSL terminal</strong></p>
<p>Ubuntu (or your distro) from Windows Terminal — not PowerShell alone.</p>
<p><strong>2. Set the two variables in Linux</strong></p>
<pre><code>export ANTHROPIC_BASE_URL="https://&lt;relay address&gt;"
export ANTHROPIC_AUTH_TOKEN="&lt;your relay key&gt;"
# optional if the model list fails to load:
export ANTHROPIC_MODEL="claude-opus-5"
</code></pre>
<p><strong>3. Make them stick</strong></p>
<pre><code>nano ~/.bashrc
</code></pre>
<p>Paste the same exports at the bottom, save, then:</p>
<pre><code>source ~/.bashrc
</code></pre>
<p><strong>4. New WSL window, then test</strong></p>
<pre><code>echo $ANTHROPIC_BASE_URL
claude
</code></pre>
<p><strong>Common mix-up</strong></p>
<ul>
<li><p>Windows setx only helps native Windows apps. WSL Claude Code ignores it.</p>
</li>
<li><p>Empty echo in WSL means the export never landed in the Linux shell.</p>
</li>
</ul>
<p>Relay list and setup notes: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Build a Tiny Python To-Do CLI with Claude Code on Free Sign-Up Credit]]></title><description><![CDATA[A small first project to test your relay setup without burning much free sign-up credit.
Before you start

Claude Code is pointed at a relay with ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN.

You open]]></description><link>https://jliushi.hashnode.dev/build-a-tiny-python-to-do-cli-with-claude-code-on-free-sign-up-credit</link><guid isPermaLink="true">https://jliushi.hashnode.dev/build-a-tiny-python-to-do-cli-with-claude-code-on-free-sign-up-credit</guid><category><![CDATA[claude-code]]></category><category><![CDATA[Python]]></category><category><![CDATA[ai-relay]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Thu, 15 Oct 2026 09:25:46 GMT</pubDate><content:encoded><![CDATA[<p>A small first project to test your relay setup without burning much free sign-up credit.</p>
<p><strong>Before you start</strong></p>
<ul>
<li><p>Claude Code is pointed at a relay with ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN.</p>
</li>
<li><p>You opened a new terminal after setting them.</p>
</li>
<li><p>This is a personal project. A relay sees everything you send.</p>
</li>
</ul>
<p><strong>1. Start a folder</strong></p>
<pre><code>mkdir todo-cli &amp;&amp; cd todo-cli
claude
</code></pre>
<p><strong>2. First prompt</strong></p>
<pre><code>Create todo.py: a command-line to-do list.
Commands: add "text", list, done N.
Save tasks to tasks.json. Standard library only.
</code></pre>
<p><strong>3. Run it</strong></p>
<pre><code>python3 todo.py add "buy milk"
python3 todo.py list
python3 todo.py done 1
</code></pre>
<p><strong>4. Two follow-up prompts</strong></p>
<ul>
<li><p>"Add a clear command that removes finished tasks."</p>
</li>
<li><p>"Write a README with usage examples."</p>
</li>
</ul>
<p><strong>Keep credit use low</strong></p>
<ul>
<li><p>One small task per prompt.</p>
</li>
<li><p>Run /clear when you switch to a new task.</p>
</li>
<li><p>Don't paste big files you don't need.</p>
</li>
</ul>
<p><strong>If a prompt errors</strong></p>
<ul>
<li><p>401: key or credit.</p>
</li>
<li><p>404: Base URL.</p>
</li>
<li><p>429: the relay is rate limiting. Switch sites.</p>
</li>
</ul>
<p>Pick a relay with free sign-up credit: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Cloudflare Workers AI: Free Daily Quota When Relay Credit Is Gone]]></title><description><![CDATA[Your relay free sign-up credit is used up and you still need a model for a small job. Cloudflare Workers AI is on the site's free-tier backup list.
What the list says

Daily free quota
Runs on edge no]]></description><link>https://jliushi.hashnode.dev/cloudflare-workers-ai-free-daily-quota-when-relay-credit-is-gone</link><guid isPermaLink="true">https://jliushi.hashnode.dev/cloudflare-workers-ai-free-daily-quota-when-relay-credit-is-gone</guid><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Thu, 15 Oct 2026 05:21:53 GMT</pubDate><content:encoded><![CDATA[<p>Your relay free sign-up credit is used up and you still need a model for a small job. Cloudflare Workers AI is on the site's free-tier backup list.</p>
<p><strong>What the list says</strong></p>
<ul>
<li>Daily free quota</li>
<li>Runs on edge nodes</li>
<li>Meant for apps you wire up yourself</li>
</ul>
<p><strong>What it is not</strong></p>
<ul>
<li>Not a Claude Code relay. It won't replace <code>ANTHROPIC_BASE_URL</code> + a relay key.</li>
<li>Not the same models as Opus on the relay list.</li>
<li>Not unlimited. Daily free quota means limits can reset and change.</li>
</ul>
<p><strong>When to use it</strong></p>
<ol>
<li>Relay credit is gone and you need a spare for a non-Claude tool or a small app.</li>
<li>You already have a Cloudflare account and can check the current free limits there.</li>
<li>You keep company code and secrets off any third-party path.</li>
</ol>
<p>For Claude Code or Codex, pick a relay first. Workers AI is the backup lane.</p>
<p>Relays and free-tier backups: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Keep Your Relay Key in the macOS Keychain Instead of .zshrc]]></title><description><![CDATA[Putting export ANTHROPIC_AUTH_TOKEN="sk-..." in .zshrc works, but the key sits in a plain text file. On a Mac you can keep it in Keychain and load it when the shell starts.
1. Save the key to Keychain]]></description><link>https://jliushi.hashnode.dev/keep-your-relay-key-in-the-macos-keychain-instead-of-zshrc</link><guid isPermaLink="true">https://jliushi.hashnode.dev/keep-your-relay-key-in-the-macos-keychain-instead-of-zshrc</guid><category><![CDATA[macOS]]></category><category><![CDATA[claude-code]]></category><category><![CDATA[Security]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Thu, 15 Oct 2026 01:26:37 GMT</pubDate><content:encoded><![CDATA[<p>Putting <code>export ANTHROPIC_AUTH_TOKEN="sk-..."</code> in .zshrc works, but the key sits in a plain text file. On a Mac you can keep it in Keychain and load it when the shell starts.</p>
<p><strong>1. Save the key to Keychain</strong></p>
<pre><code>security add-generic-password -a "$USER" -s relay-key -w "&lt;your relay key&gt;"
</code></pre>
<p><strong>2. Load it in ~/.zshrc</strong></p>
<pre><code>export ANTHROPIC_BASE_URL="https://&lt;relay address&gt;"
export ANTHROPIC_AUTH_TOKEN="$(security find-generic-password -a "$USER" -s relay-key -w)"
</code></pre>
<p><strong>3. Open a new terminal and test</strong></p>
<pre><code>echo ${ANTHROPIC_AUTH_TOKEN:0:6}
claude
</code></pre>
<p>Say hello in Claude Code. If it answers, you're done.</p>
<p><strong>Changing or removing the key</strong></p>
<ul>
<li><p>New key: security delete-generic-password -s relay-key, then run step 1 again.</p>
</li>
<li><p>Codex: use the same trick for RELAY_API_KEY, since config.toml only names the variable.</p>
</li>
</ul>
<p><strong>If it breaks</strong></p>
<ul>
<li><p>Empty output in step 3: the service name doesn't match. Use relay-key in both commands.</p>
</li>
<li><p>401: the key you saved is incomplete. Copy it again from the relay dashboard.</p>
</li>
</ul>
<p>Relay list and setup guide: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Codex Ignores Your Key Until You Export RELAY_API_KEY]]></title><description><![CDATA[This is for Codex CLI with a relay. You put env_key = "RELAY_API_KEY" in config.toml. Codex still acts like you have no key.
What env_key actually does
It only names the environment variable. It does ]]></description><link>https://jliushi.hashnode.dev/codex-ignores-your-key-until-you-export-relay-api-key</link><guid isPermaLink="true">https://jliushi.hashnode.dev/codex-ignores-your-key-until-you-export-relay-api-key</guid><category><![CDATA[codex]]></category><category><![CDATA[ai-relay]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[.env]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Wed, 14 Oct 2026 13:35:35 GMT</pubDate><content:encoded><![CDATA[<p>This is for Codex CLI with a relay. You put env_key = "RELAY_API_KEY" in config.toml. Codex still acts like you have no key.</p>
<p><strong>What env_key actually does</strong></p>
<p>It only names the environment variable. It does not store the key. If that variable is empty in your shell, Codex has nothing to send.</p>
<p><strong>Fix</strong></p>
<pre><code>export RELAY_API_KEY="&lt;your relay key&gt;"
codex
</code></pre>
<p>To keep it after you close the terminal, add the same export to your shell config (zshrc, bashrc, or PowerShell profile), then open a new terminal.</p>
<p><strong>Minimal config.toml reminder</strong></p>
<pre><code>model = "gpt-5.6"
model_provider = "relay"

[model_providers.relay]
name = "relay"
base_url = "https://&lt;relay address&gt;/v1"
env_key = "RELAY_API_KEY"
wire_api = "chat"
</code></pre>
<p>Copy the model name from the relay's own list. Keep /v1 on the Codex base_url. Don't paste the key into config.toml.</p>
<p><strong>Quick checks</strong></p>
<ul>
<li>echo $RELAY_API_KEY — should print your key, not blank.</li>
<li>401: key missing, truncated, or credit gone.</li>
<li>404: base_url /v1 problem, not the env var.</li>
</ul>
<p>Relay list and Codex notes: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item><item><title><![CDATA[Codex CLI on macOS with a Relay: config.toml and zshrc, Step by Step]]></title><description><![CDATA[This is the macOS version. You need Codex CLI installed and a relay key.
1. Pick a relay that supports Codex
On the tested list, AgentRouter is marked for both Claude Code and Codex. Relays marked Cla]]></description><link>https://jliushi.hashnode.dev/codex-cli-on-macos-with-a-relay-config-toml-and-zshrc-step-by-step</link><guid isPermaLink="true">https://jliushi.hashnode.dev/codex-cli-on-macos-with-a-relay-config-toml-and-zshrc-step-by-step</guid><category><![CDATA[codex]]></category><category><![CDATA[macOS]]></category><category><![CDATA[ai-relay]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[江流石]]></dc:creator><pubDate>Wed, 14 Oct 2026 09:25:46 GMT</pubDate><content:encoded><![CDATA[<p>This is the macOS version. You need Codex CLI installed and a relay key.</p>
<p><strong>1. Pick a relay that supports Codex</strong></p>
<p>On the tested list, AgentRouter is marked for both Claude Code and Codex. Relays marked Claude Code only won't work with Codex. Sign up, then create a key on the Tokens (令牌) page and note the base URL.</p>
<p><strong>2. Edit config.toml</strong></p>
<pre><code>mkdir -p ~/.codex
nano ~/.codex/config.toml
</code></pre>
<p>Paste this and fill in the relay's address:</p>
<pre><code>model = "gpt-5.6"
model_provider = "relay"

[model_providers.relay]
name = "relay"
base_url = "https://&lt;relay address&gt;/v1"
env_key = "RELAY_API_KEY"
wire_api = "chat"
</code></pre>
<p>Use a model name from the relay's own list, copied exactly. Keep <code>/v1</code> at the end of base_url for Codex.</p>
<p><strong>3. Put the key in ~/.zshrc</strong></p>
<pre><code>echo 'export RELAY_API_KEY="&lt;your key&gt;"' &gt;&gt; ~/.zshrc
source ~/.zshrc
</code></pre>
<p>The key goes in an environment variable, not in config.toml.</p>
<p><strong>4. Run it</strong></p>
<pre><code>codex
</code></pre>
<p><strong>If it fails</strong></p>
<ul>
<li>404: check the base URL and <code>/v1</code>.</li>
<li>401: check the key and your remaining credit.</li>
<li>Errors right away on every request: keep <code>wire_api = "chat"</code>.</li>
</ul>
<p>Relay list and the full Codex setup notes: <a href="https://jliushi.github.io/ai-relay/">jliushi.github.io/ai-relay</a></p>
]]></content:encoded></item></channel></rss>