Skip to main content

Check Opencode Free Models

Python MCP Client PyPI License

🌐 English · Türkçe

check-opencode-free-models is a tiny tool that keeps the free chat models published by the OpenCode Console in sync with ~/.config/opencode/opencode.jsonc.

It fetches https://opencode.ai/inference/v1/models (no auth), filters free chat models, compares them against provider.opencode-api.models, reports drift (added / removed), and — with --apply — rewrites the block in place after taking a timestamped backup.

Source & references

What gets pulled from where

Source What Target
https://opencode.ai/inference/v1/models (no auth) Free chat models (type == "chat", cost.text.input/output.price == 0) — id + name ~/.config/opencode/opencode.jsonc → provider.opencode-api.models
Existing config Preserves already-stored name values on update merged into the rewritten block
--apply Rewrites the block; backup opencode.jsonc.bak-YYYY-MM-DD-HH_MM_SS same file

Nothing else is read or written. The example config opencode-free-models.config.example.jsonc shows the shape of the opencode-api block (redacted, no secrets).

Current free chat models

As of 2026-11-20, the Console lists 11 free chat models (run the script to refresh):

  • beam-free — Beam Free
  • big-pickle — Big Pickle
  • deepseek-v4.1-flash-free — DeepSeek V4.1 Flash Free
  • flint-40b-free — Flint 40B Free
  • hy4-flash-free — Hy4 flash Free
  • iceman-free — Iceman Free
  • longcat-2.5-free — LongCat 2.5 Free
  • mimo-v2.6-flash-free — MiMo-V2.6-Flash Free
  • nemotron-3.5-lightning-free — Nemotron 3.5 Lightning Free
  • nemotron-3.5-super-vl-free — Nemotron 3.5 Super VL Free
  • tidepool-alpha-free — Tidepool Alpha Free

How it works

  1. Fetch — fetch_free_ids() reads every model from the source endpoint. Filter: cost.text.input.price == 0 && cost.text.output.price == 0 and type == "chat".
    • Decision models (type: decision, e.g. Jev jev-1.13-free) are not chat (recommended_api: systemone), so they are never written to the opencode-api block.
  2. Drift — read_config_models() reads the id -> name map from provider.opencode-api.models. Diff against the live free list: added, removed.
  3. Apply — with --apply:
    • Backup opencode.jsonc.bak-YYYY-MM-DD-HH_MM_SS (shutil.copy2, metadata preserved).
    • build_block() joins lines with commas (no trailing comma).
    • pattern.subn rewrites the opencode-api models block.
    • Validate-before-write: the rewritten text is parsed with json.loads(new_text) before the file is touched; on failure the config is left untouched.

Idempotent: re-running --apply reports no drift.

Usage

python3 check-opencode-free-models.py            # drift report (exit 0: in sync, 1: drift)
python3 check-opencode-free-models.py --apply    # update, with backup

Example output:

canlı ücretsiz sohbet modeli: 11
config'deki model           : 11
eklenecek : -
kaldırılacak: -
SONUÇ: güncel, fark yok.

OpenCode Desktop and crontab

This tool targets OpenCode Desktop's own ~/.config/opencode/opencode.jsonc — it never touches any other config file.

Apply updates automatically with --apply, or run a daily drift check from crontab:

0 6 * * * /path/to/check-opencode-free-models/check-opencode-free-models.py

Exit code 1 on drift (SONUÇ: drift var. --apply ile güncelle.), 0 when in sync (SONUÇ: güncel, fark yok.).

Files

File Description
check-opencode-free-models.py Working script (live endpoint, drift, apply + backup).
opencode-free-models.config.example.jsonc Example opencode-api block (redacted, no secrets).
README.md This file (English).
README.tr.md Turkish tour.
CHANGELOG.md Release history.
CONTRIBUTING.md Development setup and checks.
LICENSE MIT.

Project structure

check-opencode-free-models/
├── check-opencode-free-models.py
├── opencode-free-models.config.example.jsonc
├── README.md
├── README.tr.md
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── .gitignore
└── docs/
    └── README.md

Testing & CI

There is no automated test suite yet. Before a change:

  • python3 -m py_compile check-opencode-free-models.py — syntax.
  • python3 check-opencode-free-models.py — drift report (exit 0 when in sync).

Documentation

Future ideas

  1. Atomic write — tempfile + os.replace after validation.
  2. Robust type filter — m.get("type") or "chat".
  3. Decision-model WARN — report skipped type=decision models.
  4. Unit tests — make ENDPOINT/CONFIG env-overridable and mock urllib.
  5. --dry-run alias.
  6. recommended_api routing — systemone endpoint is currently 404.

License

MIT — see LICENSE.

Metadata

Release files for check-opencode-free-models 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for check-opencode-free-models 1.0.2
File Size Uploaded Provenance Actions
check_opencode_free_models-1.0.2.tar.gz 9.1 kB Without provenance Details for check_opencode_free_models-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for check-opencode-free-models 1.0.2
File Interpreter ABI Platform Actions
check_opencode_free_models-1.0.2-py3-none-any.whl Python 3 none any Details for check_opencode_free_models-1.0.2-py3-none-any.whl

Total release size: 16.3 kB

Release files / check_opencode_free_models-1.0.2.tar.gz

Download URL check_opencode_free_models-1.0.2.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ea47ba66c16d85d2732f1a7b26e3f746a7f4d096bc350ab2ace01946789f8b52
BLAKE2b-256 checksum
How to use checksums
ff523609cd51551c4fab0d80165d399eea809e17885e8546807a7ac24a1b5bad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / check_opencode_free_models-1.0.2-py3-none-any.whl

Download URL check_opencode_free_models-1.0.2-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45ef7101ce3c858cd29db9574ae054c5380ae43d26295be3c70c5bced9a067ad
BLAKE2b-256 checksum
How to use checksums
fb3d2e55b6bfa757c3523f6757febc95fe1f80c834cdef5e741179ad05ca3512
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for check-opencode-free-models 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page