A Pi package that adds deAPI: image, video, speech and music generation, transcription of files and YouTube, TikTok, X, Twitch and Kick links, video description and OCR, plus deAPI's chat models as a Pi model provider.
It contains:
- an extension that registers deAPI's hosted MCP server (
https://mcp.deapi.ai/mcp) asdeapi, with its tools loaded through tool search, so they do not take up context until needed; - the
deapimodel provider: deAPI's chat models (OpenAI-compatible API athttps://oai.deapi.ai/v1) in/model, nomodels.jsonneeded; - a
deapiskill that tells the agent which tool fits which task, to check prices before long jobs and not to guess model names.
pi install npm:@deapi/piThen authenticate in one of two ways:
- API key: create one at app.deapi.ai/settings/api-keys, set
DEAPI_API_KEYin your environment and start Pi. - Sign in: without
DEAPI_API_KEY, open/mcpin Pi, selectdeapiand sign in.
Try: "Transcribe https://www.youtube.com/watch?v=... and summarise it" or "Make a 16:9 image of a lighthouse at dusk".
pi mcp add deapi --url "https://mcp.deapi.ai/mcp?source=pi" --bearer-token-env-var DEAPI_API_KEYA deapi entry in mcp.json takes precedence over the one this package registers.
With DEAPI_API_KEY set, open /model and pick a deapi model, or start Pi with one:
pi --model deapi/seed-2.0-minipi --list-models deapi lists them. At startup the extension reads the model list from GET https://oai.deapi.ai/v1/models (context window, output limit, image input, reasoning and the prices for your account) and falls back to a built-in list (prices shown as 0) when the catalog does not answer within about 1.5 seconds; /model refreshes it and keeps the last list that loaded. The key can also be stored with /login instead of the environment variable.
- Costs: Pi estimates the cost from token counts and the catalog prices. The exact charge of each request is
usage.costin the response and in your deAPI dashboard. With the built-in list (catalog not reached) the prices show as 0. - Thinking:
/thinkingmaps to deAPI'sreasoning_effort.offsendsnone(reasoning off);xhighandmaxare available.glm-5.3offers only low, high and max. Reasoning tokens count toward the output limit. - Retries are billed. deAPI charges every chat request it completes, also a retried one. Pi retries transient failures by default (
retry.enabledin settings); turn it off if you prefer to retry by hand. - Only
/v1/chat/completionsis used; deAPI has no Responses API. Images are sent inline (base64), which deAPI accepts on the models with image input.
- Jobs are paid from your deAPI balance. Every generation tool has a
*_pricetwin that returns the cost without running the job. - Requests carry
?source=piand anX-Deapi-Source: pi/<version>header (for examplepi/0.2.1) so deAPI can see traffic from this package. Nothing about you or your prompts is added.
MIT