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
- 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.
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.
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"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"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
- Codex: advanced configuration[1] (developers.openai.com)
Config names and menu paths match these pages as of the date shown. If Codex changes them, its docs win.
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.
Codex, as it is
Your prompts, files and workflow stay as they are. The request leaves in the same format as before.
One address, one key
It goes to
https://api.straitly.ai/v1with your Straitly key. That is the whole setup.[1]The same models
The key reaches 117 models. You ask for each one by its model ID.[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]
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.
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.
Which other tools use the same key?
- Claude CodeAnthropic Messages. Env vars or settings.json.
- CursorOpenAI-compatible. Settings, no script.
- OpenCodeOpenAI-compatible. opencode.json provider.
- ClineOpenAI-compatible. Settings, no script.
- Claude appAnthropic Messages. Developer menu gateway.
- HermesOpenAI-compatible. Custom endpoint.
- OpenClawOpenAI-compatible. Custom provider.
- OpenAI SDKOpenAI-compatible. Python client.
- Anthropic SDKAnthropic Messages. Python client.
- LangChainOpenAI-compatible. Python client.
- LlamaIndexOpenAI-compatible. Python client.
- Vercel AI SDKOpenAI-compatible. TypeScript client.
Start with one request.
Prepaid, no subscription, no minimum. 40% under list on most models you reach from Codex.