GuidesInference APIs
Codex CLI
Point the OpenAI Codex CLI at OpenRelay through the Responses endpoint, with a config.toml provider block and an OpenRelay API key.
Codex talks to models through the
Responses endpoint. Add OpenRelay as a model
provider in ~/.codex/config.toml:
model = "openrelay/<model>"
model_provider = "openrelay"
[model_providers.openrelay]
name = "OpenRelay"
base_url = "https://inference.openrelay.inc/v1"
env_key = "OPENRELAY_API_KEY"
wire_api = "responses"Then export your API key and run Codex:
export OPENRELAY_API_KEY=or_...
codexUse a model whose supported_apis lists responses (see
GET /v1/models). Copy-ready config for each model
is on its page in the dashboard, under the Responses tab.
What to expect
- Conversation state. Codex sends the whole conversation on every turn
with
store: false, which is how OpenRelay serves Responses. - Prefix caching. Codex sends its session id as
prompt_cache_key, which OpenRelay passes to the model. A later turn that lands on a replica holding its prefix reuses the cache. Only the cached tokens the model reports bill at the cached-input rate. - Web search. Codex can send the hosted
web_searchtool. OpenRelay removes it, and the model works without search. - Shell and patch tools. These are client tools: the model emits the call and Codex runs it on your machine.
- Context. A Codex session starts near 9,000 tokens of instructions and tools, so it needs the 32,768-token or larger window every Responses model has.
Responses (OpenAI)
POST /v1/responses, the OpenAI Responses endpoint in stateless mode, the fields it refuses, its typed streaming events, and how responses are billed.
Embeddings
POST /v1/embeddings, the OpenAI-compatible embeddings endpoint, its request and response shapes, limits, and input-only billing.