MixMedia Sign in
Codex CLIOpenAI

Codex CLI and OpenCode with MixMedia

In short: take an API key from the Dashboard and use the base URL https://api.mixmedia.tech/v1 in one of two ways. Codex CLI: install it with npm, create the ~/.codex folder (%USERPROFILE%\.codex on Windows), put config.toml and auth.json with your key there and run codex. OpenCode in VS Code or the terminal: create ~/.config/opencode/opencode.json with the same key and URL and launch the editor or CLI. Both setups are tested on a live run: file edits, commands, streaming.

Pay with a Russian card, SBP or SberPay — no foreign card, no VPNTop up from $5 (Russian cards, SBP, SberPay; any card in USD). Usage is charged per token from your balance, no subscription.Top up
Before you start

Get an API key

Sign in at mixmedia.tech, open Dashboard → API keys and click “Create key”. The key starts with sk-aim-. It is the same key as for images and video, with one shared balance.

Top up in Dashboard → Balance. No subscription: you pay only for the tokens the model actually used.

Choose how to connect

Option A: Codex CLI (terminal)

Step 1 of 4

Install Codex CLI

You need Node.js 18+. Then run in your terminal (PowerShell on Windows):

BASH
npm install -g @openai/codex

Codex CLI is OpenAI’s official tool for coding with AI right from the terminal: it reads the project, edits files and runs commands. Check: codex --version. Already installed? The same command updates it.

Step 2 of 4

Create the configuration folder

macOS / Linux:

BASH
mkdir -p ~/.codex

Windows: press Win + R, type %USERPROFILE%\.codex and hit Enter. If the folder does not exist, create it by hand or with PowerShell:

PowerShell
New-Item -ItemType Directory -Force "$env:USERPROFILE\.codex" | Out-Null
Step 3 of 4

Configure the files

File 1: config.toml

SystemPath
Windows%USERPROFILE%\.codex\config.toml
macOS / Linux~/.codex/config.toml

Paste exactly this at the very top of the file:

TOML
model_provider = "mixmedia"
model = "gpt-6.1-sol"
review_model = "gpt-6.1-sol"
model_reasoning_effort = "high"

[model_providers.mixmedia]
name = "MixMedia"
base_url = "https://api.mixmedia.tech/v1"
wire_api = "responses"
requires_openai_auth = true
LineMeaning
model_providerwhich provider block below to use
model / review_modelmodel for work and for /review
model_reasoning_effortreasoning depth: low, medium, high, xhigh
base_urlhttps://api.mixmedia.tech/v1
wire_apiresponses — Codex only speaks the Responses API
requires_openai_authread the key from auth.json

File 2: auth.json

SystemPath
Windows%USERPROFILE%\.codex\auth.json
macOS / Linux~/.codex/auth.json

Paste exactly this:

JSON
{
  "OPENAI_API_KEY": "sk-aim-YOUR_KEY"
}
⚠️ Replace sk-aim-YOUR_KEY with the key from Dashboard → API keys.

Instead of writing auth.json by hand you can save the key with a command (Codex writes the file itself):

BASH
echo sk-aim-YOUR_KEY | codex login --with-api-key

If you signed in to Codex with ChatGPT before, auth.json already exists: replace its whole content.

Step 4 of 4

Launch Codex CLI

BASH
cd your-project
codex

The header should show model: gpt-6.1-sol and provider: mixmedia. A one-shot task without the chat:

BASH
codex exec "create hello.py that prints hi and run it"
CommandWhat it does
/modelswitch model and reasoning depth
codex -m gpt-6-astrastart with another model
codex resume --lastcontinue the last session
/reviewreview the changes in the repo

Models for Codex

ModelIDInput / 1MOutput / 1MCache read / 1M
GPT-6 Astragpt-6-astra$10.4$52$1.04
GPT-6.1 Solgpt-6.1-sol$2.08$10.4$0.104
GPT-6.2 Solgpt-6.2-sol$2.08$10.4$0.104
GPT-6.2 Astragpt-6.2-astra$8.32$41.6$0.416
GPT-5.6gpt-5.6$4.16$20.8$0.416
DeepSeek V4 Prodeepseek-v4-pro$0.6686$2.0058$0.0669
DeepSeek V4.1 Flashdeepseek-v4.1-flash$0.1486$0.5942$0.0149

Prices for Claude Code, Codex, Gemini CLI, OpenCode, Cline and similar coding tools. The same models via a regular API call cost a bit more. Cache-read price depends on the model (see the table). Cache write is 1.25× the input price in the same column. A 1-hour cache write is 2× input for Claude and 2.5× input for GPT. Long context: Claude Haiku 5.5: prompts over 100k tokens — coding $0.52 / $2.6, direct API $0.6 / $3; GPT-6 Astra: prompts over 272k tokens — coding $20.8 / $78, direct API $24 / $90; GPT-6.1 Sol: prompts over 272k tokens — coding $4.16 / $15.6, direct API $4.8 / $18; GPT-6.2 Sol: prompts over 272k tokens — coding $4.16 / $15.6, direct API $4.8 / $18; GPT-6.2 Astra: prompts over 272k tokens — coding $16.64 / $62.4, direct API $19.2 / $72; GPT-5.6: prompts over 272k tokens — coding $8.32 / $31.2, direct API $9.6 / $36.

Codex works with GPT only. Best picks: gpt-6.1-sol (fast and cheap) and gpt-6-astra (strongest). With gpt-5.6 Codex prints “Model metadata … not found” and runs without its own file-patch tool, so use it in OpenCode instead. For Claude and Gemini use Claude Code, Gemini CLI or OpenCode.

Codex in VS Code

The Codex extension for VS Code, Cursor and Windsurf (Ctrl+Shift+X → “Codex” by OpenAI) reads the same config.toml and auth.json, so nothing else to set up after step 3. If it offers a ChatGPT sign-in, close it and restart the editor.

Troubleshooting

Codex asks to sign in with ChatGPT

The line model_provider = "mixmedia" must be at the very top of config.toml, before [model_providers.mixmedia], and auth.json must hold your key. Check: codex login status.

“Codex is ignoring 1 unrecognized configuration setting”

config.toml still has a line from old guides, e.g. disable_response_storage or windows_wsl_setup_acknowledged. Current Codex versions do not know them and already send requests with store: false. Delete the line. Check the file: codex exec --strict-config "ok".

401 Unauthorized

The key in auth.json is incomplete or deleted. Create a new one in the Dashboard.

402 / insufficient balance

Top up in Dashboard → Balance.

«The Responses API is available for GPT models»

A Claude or Gemini model is set in Codex. Use gpt-6.1-sol or gpt-6-astra.

Option B: OpenCode (VS Code extension / CLI)

Step 1 of 4

Install OpenCode

OpenCode comes as a terminal app, a VS Code extension and a desktop app. All three read the same config file. The terminal version needs Node.js 18+:

Terminal / PowerShell
npm install -g opencode-ai

VS Code extension: Ctrl+Shift+X → search “opencode” → Install. Check: opencode --version.

Step 2 of 4

Create the config file

SystemPath
Windows%USERPROFILE%\.config\opencode\opencode.json
macOS / Linux~/.config/opencode/opencode.json

Create the folder if it does not exist; OpenCode does not create the file itself:

macOS / Linux
mkdir -p ~/.config/opencode
Windows PowerShell
New-Item -ItemType Directory -Force "$env:USERPROFILE\.config\opencode" | Out-Null

The exact path on your machine: opencode debug paths, line config.

Step 3 of 4

Configure opencode.json

Paste exactly this. OpenCode’s built-in OpenAI provider talks to our URL over the Responses API, like Codex:

JSON
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "openai": {
      "options": {
        "baseURL": "https://api.mixmedia.tech/v1",
        "apiKey": "sk-aim-YOUR_KEY"
      },
      "models": {
        "gpt-6.1-sol": {
          "name": "GPT-6.1 Sol (MixMedia)",
          "limit": { "context": 272000, "output": 128000 },
          "options": { "store": false },
          "variants": { "low": {}, "medium": {}, "high": {}, "xhigh": {} }
        },
        "gpt-6-astra": {
          "name": "GPT-6 Astra (MixMedia)",
          "limit": { "context": 272000, "output": 128000 },
          "options": { "store": false },
          "variants": { "low": {}, "medium": {}, "high": {}, "xhigh": {} }
        },
        "gpt-5.6": {
          "name": "GPT-5.6 (MixMedia)",
          "limit": { "context": 272000, "output": 128000 },
          "options": { "store": false },
          "variants": { "low": {}, "medium": {}, "high": {}, "xhigh": {} }
        }
      }
    }
  },
  "agent": {
    "build": { "options": { "store": false } },
    "plan": { "options": { "store": false } }
  }
}
⚠️ Replace sk-aim-YOUR_KEY with the key from Dashboard → API keys.

variants are reasoning levels you can switch in OpenCode (or --variant high on the command line). "store": false turns off server-side response storage. To add Claude, put the anthropic block from the OpenCode guide next to it.

ModelIDInput / 1MOutput / 1MCache read / 1M
GPT-6 Astragpt-6-astra$10.4$52$1.04
GPT-6.1 Solgpt-6.1-sol$2.08$10.4$0.104
GPT-6.2 Solgpt-6.2-sol$2.08$10.4$0.104
GPT-6.2 Astragpt-6.2-astra$8.32$41.6$0.416
GPT-5.6gpt-5.6$4.16$20.8$0.416
DeepSeek V4 Prodeepseek-v4-pro$0.6686$2.0058$0.0669
DeepSeek V4.1 Flashdeepseek-v4.1-flash$0.1486$0.5942$0.0149

Prices for Claude Code, Codex, Gemini CLI, OpenCode, Cline and similar coding tools. The same models via a regular API call cost a bit more. Cache-read price depends on the model (see the table). Cache write is 1.25× the input price in the same column. A 1-hour cache write is 2× input for Claude and 2.5× input for GPT. Long context: Claude Haiku 5.5: prompts over 100k tokens — coding $0.52 / $2.6, direct API $0.6 / $3; GPT-6 Astra: prompts over 272k tokens — coding $20.8 / $78, direct API $24 / $90; GPT-6.1 Sol: prompts over 272k tokens — coding $4.16 / $15.6, direct API $4.8 / $18; GPT-6.2 Sol: prompts over 272k tokens — coding $4.16 / $15.6, direct API $4.8 / $18; GPT-6.2 Astra: prompts over 272k tokens — coding $16.64 / $62.4, direct API $19.2 / $72; GPT-5.6: prompts over 272k tokens — coding $8.32 / $31.2, direct API $9.6 / $36.

Step 4 of 4

Launch and pick a model

Terminal
cd your-project
opencode

In VS Code restart the editor and open OpenCode in the left sidebar. The desktop app picks up the same opencode.json.

One-shot: opencode run -m openai/gpt-6.1-sol "fix the bug in calc.py"

CommandWhat it does
/modelsswitch model (look for “MixMedia”)
@файлattach a file to the prompt
/helpall commands
/exitquit

Troubleshooting

MixMedia models are missing in /models

Check the path from opencode debug paths and that the file is valid JSON (no trailing comma).

401

The key in apiKey is incomplete. Copy it again from the Dashboard.

⚠️ About cache and cost. Codex and OpenCode re-send the conversation on every step. Re-sent context is billed at the cache-read price (see the table; for some models it is less than 10% of input), so long sessions cost less than they look. Server-side response storage is off: Codex does it automatically, OpenCode via "store": false in the config above. Per-request usage is in the Dashboard.

FAQ

Can I use Codex CLI from Russia?

Yes. Point Codex CLI at https://api.mixmedia.tech with your MixMedia key. It works without a VPN and without an Anthropic, OpenAI or Google account.

How do I pay from Russia?

Top up your MixMedia balance with a Russian bank card, SBP or SberPay (from $5). No foreign card needed; tokens are charged from the balance.

Do I need a VPN?

No. api.mixmedia.tech is reachable from Russia directly, both for the CLI and for the VS Code extensions.

How much does it cost?

For coding tools such as Codex CLI, from $0.104 per 1M input tokens depending on the model; cache-read prices are in the table on this page. A regular API call (not from a coding tool) costs a bit more. Full list: api.mixmedia.tech/v1/models.

How is it different from the official API?

Same models and the same API format, so the tools work unchanged. The difference is payment and access: Russian cards and SBP, no VPN, one key for Claude, GPT and Gemini. Prices are per token and may be higher than the official list price.

How do I get a key?

Sign in at mixmedia.tech, open Dashboard → API keys, click “Create key” and top up the balance.

Other tools

Questions? Telegram @mixmedia_robot.