AI News
All stories
Official

Pi 1.7.0 adds image generation to codemode through Radius and OpenRouter

Pi 1.7.0 lets codemode generate images with Radius and sets aspect ratio and size for OpenRouter image models.

Products · · 2 min read

Pi 1.7.0 lets codemode generate images through Radius. For OpenRouter image models, it adds an optional third argument to models.generateImages() that sets aspect ratio and size. The release also fixes a bug in which failed OpenRouter image responses were reported as successful. The release notes list the feature under New Features and the fix under Fixed, and they describe the new argument as optional { aspectRatio, size }.

Before 1.7.0, codemode image generation reported success even when OpenRouter returned a failed response. Pi now reports those responses as failures. The same change alters how usage is tracked. Image and classifier usage now includes reasoning tokens when the provider reports them, and image usage distinguishes image output tokens. For OpenRouter costs, the release says pi uses the reported total when there is one, and otherwise estimates from the model's image output rate. The notes do not say how large that estimate's error can be.

Radius image and classifier models are now listed in Pi's built-in catalog, in addition to being found through provider discovery. The release does not describe what Radius classifier models do or how they are priced. The notes therefore support only the narrower claim that codemode can now call Radius for images and that both model types are catalogued.

Much of the rest of the release concerns terminal session resume, which the notes describe as letting compatible terminals reopen the current pi session after a restart. Interactive mode reports a pi --session <id> command through the Program Resume Protocol (OSC 7577) when the terminal sets OSC7577_TOKEN, and pi removes that token from the environment of every process it starts. The resume command now also repeats flags such as --tools, --no-extensions, -e, --skill and --system-prompt, as typed, so that a resumed session cannot have other tools or instructions, and possibly more access, than the original. A new --agent-dir flag covers setups that use PI_CODING_AGENT_DIR. Before this change, that setting could be lost on resume and bring back the default directory's settings and auth. The notes say that terminals that resume programs, such as Rex, need a rule that trusts each flag combination.

The release also removes telemetry reporting for new installs and updates, along with the enableInstallTelemetry setting and PI_TELEMETRY, and it lists these under Breaking Changes. Several default models changed as well. The cloudflare-workers-ai and cloudflare-ai-gateway providers now default to @cf/zai-org/glm-5.3, which the notes attribute to Cloudflare deprecating Workers AI Kimi K2.6 and K2.7 Code. The ant-ling default moved from the retired Ring-2.6-1T to Ling-3.1-flash. Existing models.json files can keep thinkingFormat: "ant-ling" as a deprecated alias for "deepseek". The retired qwen4-max-preview was replaced with qwen4-max on Qwen Token Plan Individual.

What changed

Codemode can now generate images through Radius, and OpenRouter image models accept an optional third argument to models.generateImages() that sets aspect ratio and size.

Type: New capability · Applies to: codemode, Radius, OpenRouter image models, models.generateImages()

Why it matters

Developers building agents on Pi gain image generation through two providers, and cost estimates for OpenRouter images now follow the reported usage.

What you can do

If you use codemode image generation, check cost tracking against the new image output token usage.

Original source

Where we saw it

1 source

Pi releases

AI wrote this summary from the sources listed, and nobody reviewed it individually before publication. Check the original source before you rely on it. How it works