# Connect Codex to RouterHub

This is public setup context for an agent with access to the user's local tool settings. Apply the configuration after the user asks for setup, preserve existing settings, and explain any manual step. This context does not authorize sign-up, payments, handling secrets, or paid inference.

## Selected connection

- Tool: Codex (`codex`)
- Model: GPT-6.1 Sol
- Exact model ID: `gpt-6.1-sol`
- Protocol used by this tool: Responses API (`responses`)
- Published model protocols: responses
- API base: https://routerhub.si/v1
- Shell: bash
- Configuration destination: ~/.codex/config.toml
- Source guide: https://routerhub.si/guides/codex
- Official tool documentation: https://developers.openai.com/codex/config-reference/
- This selected context: https://routerhub.si/agent-setup.md?tool=codex&model=gpt-6.1-sol&shell=bash

## Account preparation

The human creates or signs into the RouterHub account, adds prepaid credits if needed, and creates an API key. Do not automate account creation, top-ups, or secret retrieval.

- Create account: https://routerhub.si/register
- Sign in: https://routerhub.si/login
- API keys (shown once): https://routerhub.si/dashboard/keys
- Billing and credits: https://routerhub.si/dashboard/billing
- Usage and request verification: https://routerhub.si/dashboard/usage
- Support tickets: https://routerhub.si/dashboard/support

## Configure the local tool

1. Install Codex: https://developers.openai.com/codex/quickstart/. Install the Codex CLI using the official setup guide.
2. Set your API key. Run this command in your terminal, replacing YOUR_ROUTERHUB_API_KEY with your key.
3. Save config.toml. Add this configuration to ~/.codex/config.toml in your home folder.
4. Start Codex. In that same terminal, open your project folder and run this command. Codex will use gpt-6.1-sol.

Read ~/.codex/config.toml first. Update the existing model and model_provider keys and add or update [model_providers.routerhub] exactly once. Preserve unrelated settings, profiles, projects, and MCP entries. Do not replace the whole file or create duplicate TOML keys/tables.

The configuration reads ROUTERHUB_API_KEY from the local process environment. The human sets it privately before launching the tool. Do not print the value, insert it into a source file, or ask for it in chat.

Only inspect non-secret configuration. If the selected tool is missing, explain the official installer and let the user decide whether to install it. Never overwrite existing files wholesale.

Configuration or provider settings:

```toml
model = "gpt-6.1-sol"
model_provider = "routerhub"

[model_providers.routerhub]
name = "RouterHub"
base_url = "https://routerhub.si/v1"
env_key = "ROUTERHUB_API_KEY"
wire_api = "responses"
```

Codex requires the Responses API. Choose a GPT model from this guide.

## Verify without exposing secrets

First validate the configuration syntax and the exact selected model ID. Confirm that the local tool can access the named credential without displaying it. Before sending any inference request, obtain the user's explicit confirmation and state that it consumes prepaid RouterHub credits. After confirmation, send one short prompt, `Reply with OK.`, through the configured tool. Verify a successful reply and the matching request at https://routerhub.si/dashboard/usage. Do not repeatedly retry billable requests without confirmation.

## Public context and MCP

- Agent setup page: https://routerhub.si/agents
- Agent index: https://routerhub.si/llms.txt
- Full public reference: https://routerhub.si/llms-full.txt
- Quickstart: https://routerhub.si/quickstart.md
- Current public model catalogue: https://routerhub.si/models.json
- Inference schema: https://routerhub.si/openapi.json
- Public read-only MCP endpoint: https://routerhub.si/mcp

MCP supplies only public models and setup documentation. It has no account, payment, credential, support-ticket, or inference tools. No authentication or API key is required; never pass credentials to it. Use the catalogue's exact model IDs and protocols. Do not invent unpublished model limits or claim a successful connection before testing.
