A Pi extension that adds Synthetic as a model provider, giving you access to open-source models through an OpenAI-compatible API.
Sign up at synthetic.new to get an API key (referral link).
The extension uses Pi's credential storage. Add your API key to ~/.pi/agent/auth.json (recommended):
{
"synthetic": { "type": "api_key", "key": "your-api-key-here" }
}Or set environment variable:
export SYNTHETIC_API_KEY="your-api-key-here"Credentials are resolved in this order:
- CLI
--api-keyflag auth.jsonentry forsynthetic- Environment variable
SYNTHETIC_API_KEY
# From npm
pi install npm:@aliou/pi-synthetic
# From git
pi install git:github.com/aliou/pi-synthetic
# Local development
pi -e ./src/index.tsOnce installed, select synthetic as your provider and choose from available models:
/model synthetic hf:moonshotai/Kimi-K2.5
The extension registers synthetic_web_search — a zero-data-retention web search tool. The tool is always visible; it fails with a clear message if credentials are missing or the account lacks a subscription.
For Synthetic models that support reasoning, Synthetic currently accepts only low, medium, and high reasoning effort values.
This extension clamps Pi reasoning levels to Synthetic's supported set:
minimal->lowlow->lowmedium->mediumhigh->highxhigh->high
Check your API usage:
/synthetic:quotas
When a Synthetic model is active, the footer status bar shows live quota usage (e.g. week:82% (↺in 3d) 5h:95%). Colors follow the same severity assessment as quota warnings: green by default, yellow/red only when projected usage is at risk. The status auto-refreshes every 60 seconds and after each turn.
The extension automatically notifies you when you approach or exceed your Synthetic API quotas. Notifications fire on severity transitions only (no repeated alerts for the same level) and use correct terminology (regen/tick/resets) with precise time formatting.
- Escalation always notifies
highandcriticallevels have no cooldownwarninglevel has a 60-minute cooldown
Each feature (provider, web search, quotas command, usage status, quota warnings) is a separate Pi extension. You can disable individual features using pi config:
pi config extensions.disabled add @aliou/pi-synthetic/quota-warnings
This prevents the quota-warnings extension from loading while keeping the rest of pi-synthetic active. Replace quota-warnings with web-search, command-quotas, or provider to disable other features.
Models are hardcoded in src/providers/models.ts. To add or update models:
- Edit
src/providers/models.ts - Add the model configuration following the
SyntheticModelConfiginterface - Run
pnpm run typecheckto verify
git clone https://github.com/aliou/pi-synthetic.git
cd pi-synthetic
# Install dependencies (sets up pre-commit hooks)
pnpm install && pnpm preparePre-commit hooks run on every commit:
- TypeScript type checking
- Biome linting
- Biome formatting with auto-fix
# Type check
pnpm run typecheck
# Lint
pnpm run lint
# Format
pnpm run format
# Test
pnpm run testpi -e ./src/index.tsThis repository uses Changesets for versioning.
Note: Automatic NPM publishing is currently disabled. To publish manually:
- Create a changeset:
pnpm changeset - Version packages:
pnpm version - Publish (when ready): Uncomment the publish job in
.github/workflows/publish.yml
- Pi coding agent v0.50.0+
- Synthetic API key (configured in
~/.pi/agent/auth.jsonor viaSYNTHETIC_API_KEY)
