Other assistants

Pi coding agent gets Google AI plan support

Hacker News: coding agents mtford
Other assistants

Pi, an open-source coding agent, merged a google-ai-plan provider that lets Google AI Ultra subscribers sign in with Google and run Gemini models on their plan quota through the Interactions API instead of a Vertex AI project.

Key points

  • The google-ai-plan provider adds a loopback OAuth sign-in using PKCE and DPoP-bound refresh tokens.
  • Requests hit the Interactions API through the :createPerUserQuota endpoint so usage draws on the plan.
  • Models carry a google-ai-plan/ prefix because bare Gemini names still route to Vertex AI.
  • Plan failures are told apart: daily limit, model not on plan, sign-in, eligibility and kill switch.
  • pi-ai ships no Google client, so other apps must hand their own client to googleAiPlanProvider().
  • The default model is gemini-4-hydrogen, with streaming, thinking with signed thought replay, tool calls and usage.

Why it matters

If you already pay for Google AI Ultra, this closes the gap between a subscription you use in a browser and one your agent can actually spend. The provider is merged, but its default OAuth client is registered by the pi project; if you embed it in a proxy, a fork or an internal CLI, wire up your own clientId and clientSecret before shipping, since sign-ins stored against the old client will ask to authenticate again.

The google-ai-plan/ prefix is worth copying too: it keeps plan quota and Vertex billing from colliding by name. Test the failure path before you rely on it — a daily limit that surfaces as a retryable error quietly burns an agent loop, so confirm which errors are treated as terminal.

Real-world use

  • A Google AI Ultra subscriber who wants Gemini coding models billed to the plan rather than to a Vertex AI project.
  • A claude-code-proxy setup that exposes the plan's models to Claude Code and needs x-should-retry: false on /v1/messages so daily limits stop the loop.
  • A fork maintainer bundling the provider with a custom install script and shipping it as a release.
  • A self-hosted app that must register its own OAuth client because the default one belongs to the pi project.

This summary was generated by the agent from the original post on Hacker News: coding agents. The full text and all rights belong to its author and publisher. Go to original

Report this story

Is something wrong with the summary, or do you own this content? Your message comes straight to my inbox.

Type of message

Related stories

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message