SI Agent News
DevelopingGeminiAgents

A developer shows how a coding agent can call Gemini tools without an API key

Part 3 of a dev.to series wires a Gemini command-line tool into Antigravity's agy agent using keyless sign-in, and logs a live test that cost under a dollar.

$0.5485USD total for 8 live multimodal calls in the author's test

The short version

Why it matters

As coding agents start running shell commands for you, how they handle credentials and billing becomes a practical safety question. This walkthrough shows concrete habits: no keys on disk, preview before paying, and read exit codes. Those habits apply well beyond this one tool.

Two tools, two jobs

As dev.to reported in the third part of a developer series, the author splits the work between two pieces of software. The host agent is Antigravity CLI, called agy. It keeps the context of a whole code repository, plans changes and edits files. The tool is gemini-api, a command-line program that does specialized multimodal jobs: images, video, speech, music and transcription.

The split follows a change the author describes in earlier parts. On 2026-06-18, personal Free and Google AI Pro/Ultra usage of gemini-cli moved to Antigravity. In the author's setup, daily coding stays on agy's subscription quota, which runs on a 5-hour rolling window with weekly caps. Specialized rendering goes through gemini-api, with an explicit Google Cloud project to bill.

What 'keyless' means here

The key ingredient is a wrapper script, gapi-adc, and an agy skill, a packaged set of instructions that tells the agent when and how to use a tool. ADC stands for Application Default Credentials, Google's way of letting code sign in through your environment rather than a pasted secret. The wrapper fetches a temporary OAuth token and attaches the billing project to each call.

The skill sets four guardrails. First, keep ordinary coding on the agent's own quota. Second, check authorization before starting, and ask a human to re-authenticate if any required permission reads as missing. Third, preview every request with a dry run before spending money. Fourth, always name the project explicitly, since the author's projects differ in billing status.

One caution from the post: a diagnostic command finishing without an error is not proof that you are authorized. The author also warns against mistaking a successful local dry run for permission on Google's side.

The hidden hang

The most useful lesson is a trap that is easy to miss. According to the post, Antigravity's command runner opens an input pipe (stdin) even when nothing is sent. If a command-line tool checks that pipe and waits for it to end, the call freezes forever.

The upstream project handles this by closing stdin on nearly every call. The author found a gap: upstream only kept input open for two patterns, while the generate command also accepts a --stdin flag. The patched wrapper keeps input for all three cases and closes it for everything else.

The post's sample script tests both sides. A stray piped line must not leak into the prompt, and a brief passed on purpose with --stdin must arrive intact.

Built to be read by machines

The post shows how gemini-api is designed for agents rather than people. A usage command prints a 525-line command tree so an agent can discover options on its own. Schema commands print the shape of each request. Errors come back as structured JSON, not free text.

The author says the upstream project tests the tool this way. In its automated evaluations, an Antigravity SDK agent can only run shell commands and finish. It talks to a mock server and must find the right flags from the built-in help.

The live test and what it cost

On 2026-11-15, the author ran all three parts of the series end to end inside a tmux terminal session. It included 8 live multimodal calls costing $0.5485 USD in total and using 44,934 tokens. Local ffmpeg then added subtitles and combined the pieces into a 9.44-second, 720×1280 video.

The run also exposed a schema quirk. Generated text sits in a different place in the JSON depending on which command made it. Image, video and music jobs run in the background, so a free status lookup is needed to see their full token usage. The author patched both in the project.

These results are the author's own, and we have not reproduced them. Check the post's exact steps before copying anything, especially anything that touches billing.

What to watch

Try it

Before letting any agent run a command-line tool, make it use a preview or dry-run mode first, and check that the tool's exit codes tell you whether auth or input failed.

Sources and links

Liked it? Say why

Add a line for other readers.

No account needed. We never show your email. Comments with links, ads or abuse are held and not shown. Your comment shows after a quick check.

Listen to the AI Wire headlines

Listen to the AI Wire

Listen to our daily AI shows every morning: on your commute, in the shower, wherever you are

Listen to the daily shows

First reported by dev.to · Read the original. Written by the SI Agent News Desk from the reporting above.Written with AI from the source above. Every number is checked against the source. Spot a mistake? Corrections.

More AI news