pi-crof-provider
v1.0.23
Published
CrofAI provider extension for pi - Access Kimi, GLM, Qwen, DeepSeek, MiniMax, and Gemma models through the CrofAI API
Maintainers
Readme
🔗 pi-crofai-provider
Open-weight models through CrofAI
A pi provider extension with reasoning, vision, and live usage status.
Features
- OpenAI-compatible API - Uses CrofAI's
/v1/chat/completionsendpoint - Reasoning models - Support for thinking models with
reasoning_effortparameter - Vision models - Image input support on Kimi K2.5, Kimi K2.6, GLM 5.1 (Precision), and Qwen 3.5 / 3.6
- Tool use - Function calling support
- Streaming - Real-time token streaming
- Free tier - Some models available at no cost (GLM 4.7 Flash, Qwen3.5 9B)
- Usage status bar — Displays your remaining credits and daily request count in the pi footer, updated live across sessions
Available Models
| Model | Context | Vision | Reasoning | Input $/M | Cache Read $/M | Output $/M | |-------|---------|--------|-----------|-----------|-----------------|------------| | DeepSeek V3.2 | 164K | ❌ | ✅ | $0.18 | $0.04 | $0.35 | | DeepSeek V4 Flash | 1.0M | ❌ | ✅ | $0.12 | $0.00 | $0.21 | | DeepSeek V4 Flash 0731 | 1.0M | ❌ | ✅ | $0.12 | $0.00 | $0.21 | | DeepSeek V4 Pro | 1.0M | ❌ | ✅ | $0.35 | $0.00 | $0.80 | | DeepSeek V4 Pro (Lightning) | 1.0M | ❌ | ✅ | $0.80 | $0.02 | $1.60 | | DeepSeek V4 Pro 0813 | 1.0M | ❌ | ✅ | $0.35 | $0.01 | $0.80 | | Gemma 4 31B IT | 262K | ❌ | ✅ | $0.10 | $0.02 | $0.30 | | GLM 4.7 | 203K | ❌ | ✅ | $0.25 | $0.05 | $1.10 | | GLM 4.7 Flash | 203K | ❌ | ✅ | $0.04 | $0.01 | $0.30 | | GLM 5 | 203K | ❌ | ✅ | $0.48 | $0.10 | $1.90 | | GLM 5.1 | 203K | ❌ | ✅ | $0.45 | $0.08 | $2.15 | | GLM 5.2 | 1.0M | ❌ | ✅ | $0.30 | $0.05 | $1.05 | | Greg (Roleplay) | 229K | ❌ | ❌ | $0.10 | $0.02 | $0.30 | | Greg 1 Mini | 229K | ❌ | ❌ | $0.07 | $0.01 | $0.15 | | Greg 2 Super | 229K | ❌ | ❌ | $1.50 | $0.25 | $5.00 | | Greg 2 Ultra | 229K | ❌ | ❌ | $3.00 | $0.50 | $10.00 | | Kimi K2.5 | 262K | ✅ | ✅ | $0.35 | $0.07 | $1.70 | | Kimi K2.5 (Lightning) | 131K | ✅ | ✅ | $1.00 | $0.20 | $3.00 | | Kimi K2.6 | 262K | ✅ | ✅ | $0.50 | $0.05 | $1.99 | | Kimi K2.7 Code | 262K | ❌ | ✅ | $0.55 | $0.05 | $2.25 | | Kimi K3 | 1.0M | ❌ | ✅ | $2.00 | $0.25 | $8.00 | | Kimi K3 (Eco) | 1.0M | ❌ | ✅ | $1.00 | $0.10 | $4.00 | | MiMo-V2.5-Pro | 1.0M | ❌ | ✅ | $0.40 | $0.00 | $0.80 | | MiniMax M2.5 | 205K | ❌ | ✅ | $0.11 | $0.02 | $0.95 | | Qwen3.5 397B A17B | 262K | ✅ | ✅ | $0.35 | $0.07 | $1.75 | | Qwen3.5 9B | 262K | ✅ | ✅ | $0.04 | $0.01 | $0.15 | | Qwen3.6 27B | 262K | ✅ | ✅ | $0.20 | $0.04 | $1.50 | | Qwen3.8 27B | 262K | ❌ | ✅ | $0.25 | $0.06 | $2.10 |
Installation
Option 1: Using pi install (Recommended)
Install directly from GitHub:
pi install https://github.com/monotykamary/pi-crofai-providerThen set your API key and run pi:
# Recommended: add to auth.json
# See Authentication section below
# Or set as environment variable
export CROFAI_API_KEY=your-api-key-here
piGet your API key from crof.ai.
Option 2: Manual Clone
Clone this repository:
git clone https://github.com/monotykamary/pi-crofai-provider.git cd pi-crofai-providerSet your CrofAI API key:
# Recommended: add to auth.json # See Authentication section below # Or set as environment variable export CROFAI_API_KEY=your-api-key-hereRun pi with the extension:
pi -e /path/to/pi-crofai-provider
Authentication
The CrofAI API key can be configured in multiple ways (resolved in this order):
auth.json(recommended) — Add to~/.pi/agent/auth.json:
The{ "crofai": { "type": "api_key", "key": "your-api-key" } }keyfield supports literal values, env var names, and shell commands (prefix with!). See pi's auth file docs for details.- Runtime override — Use the
--api-keyCLI flag - Environment variable — Set
CROFAI_API_KEY
Get your API key from crof.ai.
Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| CROFAI_API_KEY | No | Your CrofAI API key (fallback if not in auth.json) |
Configuration
Add to your pi configuration for automatic loading:
{
"extensions": [
"/path/to/pi-crofai-provider"
]
}Usage
Once loaded, select a model with:
/model crofai kimi-k2.5Or use /models to browse all available CrofAI models.
Reasoning Effort
For reasoning models, control thinking depth:
/reasoning highValues: none, low, medium, high
Usage Status Bar
Once authenticated, the pi footer shows your CrofAI account status:
$12.35 | ⇄ 450$X.XX— Remaining credit balance (hidden when $0)⇄ N— Daily requests remaining (hidden when not on a subscription plan)
The count is fetched from CrofAI's usage API on session start and after each user prompt. Between syncs, the request count is decremented locally per turn to avoid unnecessary API calls.
API Compatibility
The CrofAI proxy differs from native provider APIs in several ways. These are handled via patch.json:
| Aspect | Native APIs | CrofAI |
|--------|------------|--------|
| Max tokens field | max_completion_tokens | max_tokens |
| Thinking format | Varies (openai, zai, qwen-chat-template) | openai (always reasoning_content) |
| Developer role | Varies per model | ✅ Supported on all models |
| Reasoning effort | Varies per model | Accepted by all reasoning models |
| store parameter | Varies | ❌ Not supported |
Note: The CrofAI
/v1/modelsendpoint does not reliably report reasoning capability. Many models that support thinking are missing thecustom_reasoningorreasoning_effortflags.patch.jsoncorrects these based on E2E testing.
API Documentation
- CrofAI Docs: https://crof.ai/docs
- OpenAI-compatible endpoint:
https://crof.ai/v1 - Models endpoint:
https://crof.ai/v1/models - Usage endpoint:
https://crof.ai/usage_api/
License
MIT
