oc-crofai
v0.1.0
Published
OpenCode plugin for CrofAI — dynamically discovers available models
Maintainers
Readme
oc-crofai
An OpenCode plugin that adds CrofAI as a first-class provider.
CrofAI provides cheap access to open-weight LLMs. This plugin dynamically discovers available models from CrofAI's API, so you always see the latest models without updating the plugin.
Installation
opencode plugin add oc-crofaiUsage
- Get an API key from crof.ai
- OpenCode will prompt you to enter your CrofAI API key when you first use the provider
- Select "CrofAI" as your provider and choose a model
Alternatively, set the CROFAI_API_KEY environment variable:
export CROFAI_API_KEY="your-api-key-here"How It Works
The plugin uses three OpenCode hooks:
config— Registers CrofAI as a provider with@ai-sdk/openai-compatibleSDK integrationprovider— Fetcheshttps://crof.ai/v1/modelson startup and maps the response (context length, pricing, reasoning capabilities) to OpenCode's model schemaauth— Provides interactive API key entry with automaticCROFAI_API_KEYenv var fallback
Models are fetched once when the provider loads. If CrofAI adds new models, simply restart OpenCode.
Thinking / Reasoning Support
All reasoning-capable models include four variants for controlling thinking depth:
| Variant | Reasoning Effort | Effect |
|---------|-----------------|--------|
| none | "none" | Disables reasoning — reduces latency and cost |
| low | "low" | Minimal thinking, faster responses |
| medium | "medium" | Balanced (default) |
| high | "high" | Maximum thinking, best reasoning |
Set the variant in your OpenCode agent config:
agent:
build:
model: crofai/kimi-k2.6
variant: highLicense
MIT
