opencode is an open-source coding agent that runs in your terminal: you describe what you want, it reads your project, edits files and runs commands. With Promptix behind it you choose the model (GLM, DeepSeek, Claude, GPT and more) and pay per use in dinars, with no foreign card and no subscription. Setup takes about two minutes.
Set up in four steps
Install opencode
Pick one. On Windows, use the installer or the binaries from the opencode install page.
curl -fsSL https://opencode.ai/v2/install | bashGet a Promptix API key
Add Promptix to opencode
This downloads a ready-made config with the Promptix provider and the models below. It contains no key.
mkdir -p ~/.config/opencodecurl -fsSL https://promptix.tn/api/opencode.json -o ~/.config/opencode/opencode.jsonThe command replaces ~/.config/opencode/opencode.json. If you already have a config, open https://promptix.tn/api/opencode.json and copy its promptix block into your provider section instead.
Start coding
Run opencode in a project folder. It starts on GLM (latest); type /models to switch to any other Promptix model at any time.
cd my-projectopencodeThe models in the config
Eight models chosen for price and quality on coding work, from independent benchmarks and from what developers actually use. The open-weight ones come first: they are the family of models companies such as Revolut now give their engineers by default. Prices are live, in TND per 1M tokens.
| Model | Use it for | Input / output |
|---|---|---|
| GLM (latest)Open-weight | Recommended daily driver: near top-tier coding scores at a low price | 0.27 / 5.42 |
| DeepSeek Flash (latest)Open-weight | Cheapest: routine edits and bulk work | 0.02 / 1.94 |
| GLM Flash (latest)Open-weight | Fast iterations and small tasks | 0.15 / 0.30 |
| MiniMax M3.1 FlashOpen-weight | Low-cost alternative, multimodal | 0.29 / 1.16 |
| Kimi (latest)Open-weight | Open-weight flagship for hard reasoning (priced like Sonnet) | 0.71 / 36.15 |
| GPT Luna (latest)Proprietary | OpenAI’s small model: quick and predictable | 0.39 / 1.94 |
| Claude Sonnet 5.5Proprietary | When the task needs judgment: reviews, tricky bugs | 7.74 / 38.71 |
| Claude Opus 5.5Proprietary | The hardest problems and long agent runs | 15.48 / 77.42 |
“latest” models
Entries marked (latest) follow the provider's newest version automatically, so your config does not go stale. To stay on one exact version, add it with its full id from the catalog, as in the second entry below.
More options
Every tool-capable model of the catalog (400+) instead of the curated list:
curl -fsSL "https://promptix.tn/api/opencode.json?models=all" -o ~/.config/opencode/opencode.jsonOn the opencode 2.x preview? Its config format is different (providers instead of provider). Use:
curl -fsSL "https://promptix.tn/api/opencode.json?v=2" -o ~/.config/opencode/opencode.jsonOr write the provider block yourself:
{ "$schema": "https://opencode.ai/config.json", "provider": { "promptix": { "npm": "@ai-sdk/openai-compatible", "name": "Promptix", "options": { "baseURL": "https://promptix.tn/api/v1", "apiKey": "{env:PROMPTIX_API_KEY}" }, "models": { "glm-latest": { "name": "GLM (latest)", "id": "~z-ai/glm-latest" }, "glm-5.3": { "name": "GLM 5.3 (pinned)", "id": "z-ai/glm-5.3" } } } }}If something fails
- 401 or “invalid API key”: the
PROMPTIX_API_KEYvariable is not set in the terminal where you launched opencode. Runecho $PROMPTIX_API_KEYto check. - “Insufficient credits”: top up in the dashboard. Set a monthly limit on the key to cap what an agent can spend.
- Promptix does not appear in /models: opencode did not read the config. Check the file is at
~/.config/opencode/opencode.json, restart opencode, and use the 2.x command above if you run the 2.x preview.
Every request appears in your usage log with its cost in TND. Coding agents resend the conversation on every step, so prompt caching matters: Promptix keeps each session on the provider that holds its cache.
Prefer Claude Code? See Anthropic API & Claude Code.