Use Codex with the Straitly API

Use Codex with Straitly in 4 steps: add a [model_providers.straitly] block with base_url https://api.straitly.ai/v1 to ~/.codex/config.toml. GPT-6.2 Astra then costs $4.80 in and $24.00 out per 1M tokens, 40% under its list price of $8.00 and $40.00.[1][3]

Updated

What changes in Codex
Setting
~/.codex/config.toml
Base URL
https://api.straitly.ai/v1
API key
sk-YOUR_KEY
API format
OpenAI Responses
Connect with
config.toml provider

Your prompts, files and workflow stay as they are. From Codex's docs, checked 16 November 2026[1]

Codex in 4 steps.

Replace sk-YOUR_KEY with your own key from the Keys page. Setting lives in ~/.codex/config.toml, base URL https://api.straitly.ai/v1.

  1. Step 1: Get a Straitly key

    Sign up with email or Google, add credits from $5 (no subscription, no minimum), then create a key on the Keys page. It starts with sk-. Keep it private.

  2. Step 2: Put the key in your environment

    Codex reads the key from the variable named in env_key, so export it in the shell that starts Codex (or add the line to your shell profile).

    Terminal · Mac / Linux

    export STRAITLY_API_KEY="sk-YOUR_KEY"
  3. Step 3: Add Straitly as a model provider

    Add these lines to ~/.codex/config.toml. The top two lines make Straitly the default provider and model. Do not name the provider openai: Codex reserves that ID.

    ~/.codex/config.toml

    model = "gpt-6.2-astra"
    model_provider = "straitly"
    
    [model_providers.straitly]
    name = "Straitly"
    base_url = "https://api.straitly.ai/v1"
    env_key = "STRAITLY_API_KEY"
    wire_api = "responses"
  4. Step 4: Restart Codex and start a new chat

    Chats started before the change keep their old settings. Start a new chat, or pass a model on the command line.

    Terminal

    codex -m gpt-6.2-sol

Checked against Codex's own docs, 16 November 2026

Config names and menu paths match these pages as of the date shown. If Codex changes them, its docs win.

Or do it in one paste.

Straitly's setup command makes the same change for you and keeps a copy of your old settings. Paste it in a terminal, not inside Codex. The full walkthrough with screenshots is in the Codex docs guide.

One paste · Mac / Linux (curl + Python 3)

curl -fsSL "https://straitly.ai/setup/codex" | STRAITLY_API_KEY="sk-YOUR_KEY" python3 -

What happens to a Codex request?

Two settings change in Codex: where requests go and which key pays for them. Everything else, from your prompts to your workflow, stays as it is.

  1. Codex, as it is

    Your prompts, files and workflow stay as they are. The request leaves in the same format as before.

  2. One address, one key

    It goes to https://api.straitly.ai/v1 with your Straitly key. That is the whole setup.[1]

  3. The same models

    The key reaches 117 models. You ask for each one by its model ID.[4]

  4. A smaller bill

    GPT-6.2 Astra for 10M input tokens and 1M output tokens costs $72.00 against $120.00 at list.[3]

Codex on Straitly in numbers
4
Steps to connect Codex[1]
40%
Straitly under the provider's list price, on most models[2]
$72.00
GPT-6.2 Astra for 10M input tokens and 1M output tokens, against $120.00 at list[3]
117
Models one key reaches from Codex[4]
$5
Smallest top-up. No subscription and no minimum[4]
$0
Charged for failed requests[2]
98 of 103
Models with a list price that are at least 40% under it[3]
134 of 145
Models priced under the lowest OpenRouter seller[3]

What should you know before relying on it?

  1. The one-paste setup writes the same provider block, keeps a copy of your old config.toml, and adds a model list for the Codex app's picker.

  2. Codex reserves the provider IDs openai, ollama, lmstudio, amazon-bedrock, amazon-bedrock-runtime and gcp. Use straitly.

  3. Both the Codex app and the CLI read ~/.codex/config.toml, so one change covers both.

What does Codex cost on Straitly?

USD per 1M tokens, input / output

ModelList priceVs listVs OpenRouterStraitly
GPT-6.2 Astragpt-6.2-astra40% lower vs list, n/a vs OpenRouter. Session $120.00 at list, $72.00 here.$8.00 / $40.00$120.00 for the session40% lowern/a$4.80 / $24.00$72.00 for the session
OpenAI: GPT-6.2 Solgpt-6.2-sol40% lower vs list, n/a vs OpenRouter. Session $30.00 at list, $18.00 here.$2.00 / $10.00$30.00 for the session40% lowern/a$1.20 / $6.00$18.00 for the session
Claude Opus 5.5claude-opus-5-540% lower vs list, 43.1% lower vs OpenRouter. Session $60.00 at list, $36.00 here.$4.00 / $20.00$60.00 for the session40% lower43.1% lower$2.40 / $12.00$36.00 for the session
Kimi K3.1 Prokimi-k3.1-pro43% lower vs list, n/a vs OpenRouter. Session $30.00 at list, $17.10 here.$2.00 / $10.00$30.00 for the session43% lowern/a$1.14 / $5.70$17.10 for the session

From the public catalog on 25 November 2026[3]. The session is one example workload, 10M input tokens and 1M output tokens. Vs list holds for the input and the output price alike. Vs OpenRouter compares with the lowest OpenRouter seller including its 5.5% credit fee, on a 3:1 input to output mix, as read on 16 November 2026; “higher” means Straitly costs more, and n/a means that read has no figure for the model at this price.

Codex questions.

Ask a question
  • Yes. Codex's configuration docs let you define [model_providers.<id>] with a base_url, an env_key and a wire_api, then select it with model_provider.
  • responses. Straitly's own Codex setup uses wire_api = "responses".
  • Yes. Set model to any Straitly model ID, for example claude-opus-5-5 or kimi-k3.1-pro, or pass it with codex -m.
  • On 2026-11-25 Straitly charged $1.20 input and $6.00 output per 1M tokens for OpenAI: GPT-6.2 Sol, against a list price of $2.00 and $10.00: 40% under list on input and output alike.
  • Chats that started before the change keep their settings. Restart Codex and start a new chat.

Sources

Setup steps follow Codex's own documentation, read on the date shown. Prices come from Straitly's public catalog.

  1. [1]Codex: advanced configurationdevelopers.openai.com, 16 November 2026
  2. [2]Straitly pricingstraitly.ai/pricing, 15 November 2026
  3. [3]Straitly public catalogstraitly.ai/api/catalog, shown on straitly.ai/models, 25 November 2026
  4. [4]Straitly home pagestraitly.ai, 16 November 2026
What each source says
[1] Codex: advanced configuration
Define [model_providers.<id>] with name, base_url, env_key and wire_api, then set model_provider at the top level.
[2] Straitly pricing
Billed per token at the pooled rate, 40% under the provider's published rate on most models, with nothing added on top. Failed requests cost nothing. No subscription, no minimum.
[3] Straitly public catalog
Every model ID with Straitly's price, the lab's official list price where one is published, and the lowest OpenRouter seller including its 5.5% credit fee.
[4] Straitly home page
One OpenAI-compatible API for 117 models. Sign up with email or Google, top-ups from $5 with no card or platform fee, base URL https://api.straitly.ai/v1, and requests move to another provider serving the same model if one goes down.

Start with one request.

Prepaid, no subscription, no minimum. 40% under list on most models you reach from Codex.