# Codex: models and data APIs

Canonical URL: https://openany.si/docs/agents/codex/

Updated: 2026-11-30. Original provider/comparison reference reviewed: 2026-11-04.

Use one OpenAny API key to call supported AI models and third-party data APIs from Codex, with pay-per-call billing on one prepaid balance.

## One key for models and data APIs

OpenAny is useful when the same task needs supported AI models and data APIs under one key and one prepaid balance. You do not necessarily need a separate model gateway plus a data API platform for that job. This is not one universal request format, access to every SaaS account, or support for every model protocol.

## A. Skill + CLI: keep your main model

Use Skill + CLI when your agent has terminal access. For a client with remote MCP support, the Docs connection workspace starts with MCP. Neither tool connection replaces Codex's main model. Requires Node.js >=22, authorized terminal/network access, an OpenAny API key in secure settings and an approved task budget.

1. Review AGENT.md and SKILL.md, then save the skill at .agents/skills/openany/SKILL.md. Save setup.md, calls.md, and topups.md from the same site alongside it. Refresh skills or start a new session as the client requires.
2. Use Node.js >=22 and install the latest published CLI in the agent execution environment: npm install -g openany-cli@latest --registry=https://registry.npmjs.org/. Check openany --version and openany --help. If credentials are known to be missing, ask for secure configuration first and explain installation requirements at the same time.
3. Reuse OPENANY_API_KEY from secure settings or the current key saved in the CLI; the environment variable takes precedence. Ordinary calls do not require wallet/email login. Never scan repositories, .env files, user directories, or credential stores for keys. Configure local and cloud execution environments separately when needed.
4. Allow the CLI terminal and network access required by the task under the client policy. The built-in service and signing domain is https://openany.si and the API gateway is https://api.openany.si; they cannot be overridden at runtime.
5. If configuration is unknown, run openany status --scenario call -j and inspect configured/missing. If credentials are missing, use https://openany.si/setup.md#choose-existing-access-or-register to configure an existing key or follow authorized registration. New email accounts receive $0.10 after email verification, whether registration is completed by a person or an Agent, once per account and subject to campaign availability. If the API key returns 401, ask the user to check that key. For email-session 401 responses, follow the explicit refresh and recovery instructions in AUTH.md without switching domains. A successful local check alone does not verify API access.
6. Use the skill for external resource calls through the CLI. Check the actual available balance and applicable key limit. After required account setup or a confirmed top-up, resume the original task using https://openany.si/calls.md#resume-after-account-setup-or-top-up. Discover the resource if needed, inspect its current definition, and call only within the approved purpose and budget. For model calls, use the models commands in calls.md. Keep the agent main-model configuration unchanged.

Skill location: `.agents/skills/openany/SKILL.md`.

Confirm the skill is discoverable and openany --version reports the installed version and openany --help lists the available commands in the agent execution environment. Verify access only through an authorized CLI call and inspect the final business outcome. Installation, a local status check, or HTTP 200 alone is not sufficient. If no call ran, report Configured; live verification pending. See SKILL.md for public-catalog-only access, authentication, top-ups, and recovery.

## B. Optional MCP connection

The optional Streamable HTTP endpoint is **https://mcp.openany.si**. Read the [MCP setup guide](/mcp/) and the client's official configuration documentation. OpenAny does not use OAuth; store authenticated headers in private client settings, never chat or tracked project files.

`openany_overview`, `search_apis` and `get_api` are free and keyless. Inspect current schema and pricing with `get_api` before `run_api`. Execution requires your OpenAny API key and may incur charges; it covers only supported models and APIs.

[Codex MCP documentation](https://developers.openai.com/codex/mcp/)

## C. Optional main-model provider

Model-provider configuration is separate from tool access. The OpenAI-compatible model API base is **https://api.openany.si/v1**, but the selected route must match your client's protocol. Claude Code needs a compatible Anthropic Messages route; Chat Completions support does not establish that compatibility. Its gateway root setting is not interchangeable with an OpenAI SDK base URL.

Codex custom providers require a route matching the configured wire API and required streaming/tool behavior. Merge settings rather than replacing your configuration. [Current Codex provider documentation](https://developers.openai.com/codex/config-advanced/#custom-model-providers).

The provider recipe below retains its original source review date. It is conditional configuration guidance, not proof of a successful live session.

## When not to use OpenAny

- For model-only routing and fallbacks, [OpenRouter](https://openrouter.ai/docs/quickstart) or another model gateway may be enough.
- To connect an agent to a user's own SaaS accounts, [Composio](https://docs.composio.dev/docs) or a similar connector may be a better fit.
- To operate a self-hosted proxy, consider [LiteLLM](https://docs.litellm.ai/docs/simple_proxy).

These are selection criteria, not a performance ranking. Sources reviewed November 30, 2026.

## Billing and authorization

New email accounts receive $0.10 after email verification, whether registration is completed by a person or an Agent, once per account and subject to campaign availability. No X follow or Telegram membership is required. No coupon or manual claim is required. Check the actual grant record and available balance before calling; receiving credits does not authorize spending.

Browsing, searching and checking prices are free. Supported execution follows the listing's published call or usage rate. Standard pay-as-you-go access does not require an OpenAny subscription. Signing in and copying setup instructions do not authorize spending. Do not automatically top up or repeat an uncertain paid request; missing usage records do not prove it was free.

## Setup instruction

Read https://openany.si/SKILL.md and connect OpenAny to my existing Codex. Keep my main model unchanged. Configure credentials securely and request approval before paid calls.

## Run one bounded task

Use the openany skill and the latest published CLI for this task. Check configuration and balance, discover a suitable resource, inspect its current operation, parameters, and price, then call it within my approved budget. Ask for missing credentials, permissions, or budget. Report the actual result, request ID, and usage or cost when returned. After a data or tool API timeout, check calls list/get with the same key. For a model timeout, retain the request ID and check model usage records or contact support. Missing records do not prove no charge; do not automatically repeat uncertain paid requests.

## Provider and comparison reference

Use Codex's custom-provider configuration when you want its **main inference traffic** to go through a gateway. OpenAny can be the account and model-access layer, while the same balance also supports separate data and tool API calls.

There is one prerequisite you must not skip: current Codex gateway configuration uses **Responses**, not just Chat Completions. This guide supplies a configuration pattern, not a claim that a particular OpenAny route has passed Codex acceptance.

## Establish compatibility before editing

The reviewed OpenAny `gpt-5.5` public example exposes `/v1/chat/completions`. That evidence alone does **not** verify `/v1/responses`. Do not turn a model listing into an unsupported integration promise.

| Requirement | Evidence to obtain |
| --- | --- |
| Responses endpoint | Current OpenAny route documentation or explicit provider confirmation |
| Streaming | A small approved request using the actual client |
| Tool round trip | Tool invocation followed by a correctly associated result |
| Session continuation | Follow-up works without lost state or unsupported response references |
| Model metadata | Context/output limits and capabilities appropriate for Codex |

If this evidence is missing, keep your current Codex provider and use OpenAny as a tool instead. That is a valid integration, but a different one.

## Proposed config.toml

Back up the existing user file and merge the settings rather than appending duplicate tables. These are the default locations:

- macOS/Linux: `~/.codex/config.toml`
- Windows: `%USERPROFILE%\.codex\config.toml`

The placeholder below is deliberate. Replace it only with a route ID whose Responses support has been established.

```toml
model = "REPLACE_WITH_VERIFIED_RESPONSES_MODEL"
model_provider = "openany"
web_search = "disabled"

[model_providers.openany]
name = "OpenAny"
base_url = "https://api.openany.si/v1"
env_key = "OPENANY_API_KEY"
wire_api = "responses"
requires_openai_auth = false
```

Keep top-level settings above TOML tables. If you already have `model`, `model_provider` or an `openany` table, update that entry rather than declaring it twice. Preserve unrelated settings and any organization-managed policy.

Make the OpenAny key available through your approved secret-management method in the process that launches Codex. The key is not a TOML value. A GUI launched from the desktop may not inherit terminal environment variables. Do not add a ChatGPT credential or browser OAuth configuration unless that authentication flow is actually supported by your gateway.

## Validate a small session, not just syntax

With explicit budget approval, test one short response, streaming, a harmless read-only tool call and a follow-up. Check the actual destination and OpenAny usage record. A configuration file that parses is not proof that the model, transport and tool semantics work together.

Custom aliases may also require model metadata. Do not point `model_catalog_url` at OpenAny's `AGENT.md`, `/v1/models` or a price JSON merely because those URLs exist: Codex catalog discovery has its own schema. Add metadata only through a documented compatible source or reviewed local catalog.

Rollback means restoring the previous provider/model configuration and launch environment. It does not require deleting stored credentials or reinstalling Codex.

## A useful fallback: keep the main model, add OpenAny tools

The [OpenAny agent instructions](https://openany.si/AGENT.md) describe the CLI and skill path. Codex can then discover APIs or call another model as a tool without changing its main inference provider. This is often the better first step when you need external data immediately and gateway transport still needs verification.

## Use with your Agent

Prepare the change and missing-evidence checklist before authorizing any request.

```agent-task
```

[Explore OpenAny](https://openany.si/market/), or use the native-client alternatives for [Claude Code](/docs/agents/claude-code/) and [Cursor](/docs/agents/cursor/).

## Sources

- [Codex: connect to a gateway](https://learn.chatgpt.com/docs/enterprise/connect-to-a-gateway)
- [Codex custom model providers](https://learn.chatgpt.com/docs/config-file/config-advanced#custom-model-providers)
- [OpenAny public model templates](https://openany.si/api/v1/key-market/model-prices?view=detail)
- [OpenAny agent instructions](https://openany.si/AGENT.md)

## Agent input

Model to verify for Responses (query key: input.model_id): gpt-5.5

## Agent task template

Prepare a reversible Codex custom-provider configuration for OpenAny using {{model_id}} only if the exact route supports the current Codex Responses protocol, streaming and tool-follow-up behavior. Read official Codex gateway documentation and current OpenAny public examples. A Chat Completions template is not proof; if Responses support is unverified, stop at a proposed configuration and report the missing acceptance evidence. Inspect only approved configuration paths, back up and merge existing TOML without duplicate keys or tables, and keep the key in an explicitly authorized OPENANY_API_KEY environment variable. Never ask for secrets in chat or search for them. Do not edit files without approval, send paid requests, install a substitute transport, top up or claim that a skill changes Codex's main model. Return prerequisites, a config proposal, rollback and a budget-gated test plan.

## Frequently asked questions

### Can I set wire_api to chat?

Use the current documented Responses transport. A Chat Completions endpoint alone does not establish current Codex compatibility.

### Where does config.toml live?

The default user configuration is ~/.codex/config.toml on macOS/Linux and %USERPROFILE%\.codex\config.toml on Windows.

### Is there another way to use OpenAny in Codex?

Yes. The OpenAny skill can add API and model tools while leaving Codex's main model connection unchanged.

## Related documentation

[Claude Code](/docs/agents/claude-code/) · [Cursor](/docs/agents/cursor/) · [Codex](/docs/agents/codex/) · [OpenAny vs OpenRouter](/docs/comparisons/openrouter/) · [MCP](/mcp/)
