liveapi-service

A generator for a client service that connects an application to Gemini LiveAPI over a WebSocket. The generated service handles messages, session setup and resumption, and refreshing bearer tokens used for authentication.

In plain words
What is it for?
Use it to create a LiveAPI client in the programming language you choose. It copies and checks the protocol references, then generates the service and any needed reproducible environment setup.
Why use it?
It gives developers a starting implementation for the connection and session details that are easy to get wrong when integrating a live model API.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/googlecloudplatform/vertex-ai-samples/live_api
Any agent
npx skills add GoogleCloudPlatform/vertex-ai-samples --skill live_api
Clone the repo
git clone --depth 1 https://github.com/GoogleCloudPlatform/vertex-ai-samples

Made for: Claude Code, Codex.

Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,058 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00080 $0.01058
Opus 5 $0.00040 $0.00529
Sonnet 5 $0.00016 $0.00212
Haiku 4.5 $0.00008 $0.00106

Measured 2d ago against content hash a7e661314ef0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

liveapi-service scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/genai-sdk/references/live_api/SKILL.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LiveAPI Service Skill

Provided files in references:

  • client_server_messages.md: The public document of protos used for LiveAPI.
  • client_server_messages.proto: The proto generated based on the client_server_messages.md.
  • session_manager.md: Describes how to correctly handle the sessions.

What you should do:

Step 1:

Copy existing reference files to user provided destination folder

Step 2:

Examine the public documents mentioned in client_server_messages.md. Checking if there are any discrepancies between the public documents and the created markdown / proto as client_server_messages. If yes, update these file in the destination folder

Step 3:

Implement a class in the user wanted coding language that work as a LiveAPI service, it should import the existing proto file, build the connection to the LiveAPI endpoint, expose functions to user and let user able to send and receive data to / from the model.

If a language need a specific environment, such as python, you should create the environment in the output folder and provide a bash file, by executing which, the user can recreate the correct environment, do not use or modify the existing system environment.

Wanted behavior:

The user will provide the following information to the class for initialization:

  • project_id
  • location
  • model_id
  • config, should be a ClientMessage with setup field.
  • use_gemini_enterprise, should be a boolean telling if using Gemini Enterprise or not
  • api_key, if not using Gemini Enterprise, an api_key should be provided.

If using Gemini Enterprise, you should get a bearer token, refresh it when needed, and send it with each websocket connection (including session resumption).

The class should expose the following functions to the user:

  • [async] send_realtime_data(data): allow the user to send realtime_data to the model. The data should be a ClientMessage in the proto file.
  • [async] send_client_content(data): allow the user to send non_realtime data to the model, allow the user to add context. The data should be a ClientMessage in the proto file.
  • [async] receive(): Allow the user to receive data from the model. The data received should be a ServerMessage in the proto file.

Step 4:

Once the code implemented, you should implement a test file, initialize the connection and try to send text, audio, video data and receive the response.

Ask the user for necessary information.

Step 5:

You should finally provide a markdown file with name how_to_run.md, describe how to correctly use the class you just created. You should provide full example about how to correctly build clientmessage for all kinds of support modalities and how to send them. Also you should describe how to correctly fetch data from the model.

Step 6:

You should create scripts to deploy your implementation as a service, it should contains both frontend UI and backend service [You can use whatever coding language you want]. In these service, the user can use the frontend UI to test your implementation, it should allow the user to:

  • Start new connection / close current connection.
  • Select models to use.
  • Select input sources (audio or / and video [camera or screenshot]) and streaming data to model.
  • Send text message to model.
  • Heard the audio sound from model and see the model and user transcription and conversation history.

Attention

The service should reuse the ServerMessage and ClientMessage defined in the proto for sending and receiving messages.

While implementing the audio / transcription playback logic, please follow the instruction in https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/live-api/best-practices.

Make sure you correctly handle the interrupt signal from ServerMessage, which should:

  • You'll receive audio and transcription interleaved. The played audio and corresponding transcription should be time aligned.
  • Immediately stop the playing for audio and transcription.
  • Clear the playback buffer to dump unsent audio / transcription.
  • Start new chat bubbles for model / user.

Read the full file on GitHub · 121 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 121 lines · 80 tokens per session scan A a7e661314ef0

Subscribe to this mod's changes

liveapi-service is a skill published in the GitHub repository GoogleCloudPlatform/vertex-ai-samples (780 stars, last pushed 7d ago), licensed Apache-2.0. It adds 80 tokens to every session and 1,058 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

retro-marimo-pair

Session retrospective for improving marimo-pair and marimo.codemode. Use when the user wants to analyze friction from a pairing session, identify what went wrong, and brainstorm improvements to the skill docs or the underlying API. Trigger on: "retro", "what went wrong", "improve the skill", "session review"…

marimo-team/marimo-pair · 84 tokens

marimo-pair

Drive a live marimo notebook as a workspace: run Python in the same kernel the user does, inspect live notebook state, and commit durable notebook changes. Use when the user wants to start a marimo notebook or pair on an active marimo session.

marimo-team/marimo-pair · 56 tokens

review-prs

Review a GitHub pull request in the googleapis/mcp-toolbox repo against the team's reviewer checklist: PR title/description conventions, linked issue, logic errors and unhandled edge cases, breaking changes, test coverage, docs updates, security (input handling), and new dependencies. Use whenever a maintainer asks…

googleapis/mcp-toolbox · 162 tokens

stale-sweep

Sweep the googleapis/mcp-toolbox repo for issues and PRs with no real activity in N days (default 60), sort each by whose silence it is (the author's, ours, or nobody's), and draft the nudge or close comment. Use whenever a maintainer asks for a stale sweep, backlog cleanup, or an SLO check, e.g. "stale sweep", "find…

googleapis/mcp-toolbox · 159 tokens

triage-issues

Triage GitHub issues in the googleapis/mcp-toolbox repo: propose the correct labels (type / priority / product / status), check for duplicates, verify a bug has enough info to act on, and draft a triage comment. Use whenever a maintainer asks you to triage, label, categorize, prioritize, or "look at" an issue (or a…

googleapis/mcp-toolbox · 164 tokens

zeroclaw

Help users operate and interact with their ZeroClaw agent instance — through both the CLI (zeroclaw commands) and the REST/WebSocket gateway API. Use this skill whenever the user wants to: send messages to ZeroClaw, manage memory or cron jobs, check system status, configure channels or providers, hit the gateway API…

zeroclaw-labs/zeroclaw · 167 tokens