pi-meta-oauth

Meta Model API OAuth provider for pi — device login, API-key minting, and Muse Spark model catalog for pi.dev

Packages

Package details

extension

Install pi-meta-oauth from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-meta-oauth
Package
pi-meta-oauth
Version
0.1.1
Published
Aug 5, 2026
Downloads
not available
Author
blockedredemption
License
MIT
Types
extension
Size
1.5 MB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions/meta.ts"
  ],
  "image": "https://raw.githubusercontent.com/BlockedPath/pi-meta-oauth/main/preview.png"
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-meta-oauth

Meta Model API OAuth provider for pi — use Muse Spark (muse-spark-1.2, muse-spark-1.2-contributor, muse-spark-1.1) via openai-responses inside pi.

  • Device authorization (same client as Muse Code) against https://auth.meta.com
  • Mints a Model API key via POST https://api.meta.ai/muse-code/key
  • Stores OAuth refresh = identity token + access = Model API key in ~/.pi/agent/auth.json under provider meta
  • Refresh re-mints the Model API key daily
  • Model catalog from GET https://api.meta.ai/v1/models with thinking levels minimal/low/medium/high/xhigh

Install

# local path (no publish needed)
pi install ./pi-meta-provider
# or npm (after publish)
pi install npm:pi-meta-oauth

pi --list-models meta

Login

pi
/login meta
# shows device code -> approve in browser -> mints Model API key automatically

Stored credential shape:

{ "meta": { "type": "oauth", "refresh": "<identity>", "access": "<MODEL_API_KEY>", "expires": 123 } }

Models

All three share 1,048,576 context, 256K output, supportsReasoningEffort: true, and input: ["text","image"]:

id pricing (input/output/cached) $/M
muse-spark-1.2 1.25 / 4.25 / 0.15
muse-spark-1.2-contributor 0.10 / 0.20 / 0.002
muse-spark-1.1 1.25 / 4.25 / 0.15

Add to enabledModels in ~/.pi/agent/settings.json:

{ "enabledModels": ["meta/*"] }

Verify

pi --list-models meta
pi -p --provider meta --model muse-spark-1.2 "Reply exactly: META_OK"
bun test extensions/meta.test.ts

Publish to pi.dev

pi-package keyword makes it appear at https://pi.dev/packages

npm publish --access public
# users then run: pi install npm:pi-meta-oauth

See extensions/meta.ts for the registerProvider / refreshModels / oauth implementation reused from Muse Code's launcher flow.