Skip to main content
BuildOfficialCertifiedReviewed Jul 21, 2026

Liveapi Service

v1.0.0New

Install this skill

No account required. Pick your tool, then copy.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install google-cloud-skills-liveapi-service

What this does: Generates a LiveAPI client service class in the user's chosen programming language. Use when the user wants to build, scaffold, or integrate a client that connects to the Gemini Enterprise LiveAPI websocket endpoint, handles session setup/resumption, bearer token refresh, and sending/receiving `ClientMessage`/`ServerMessage` protos. Don't use for general (non-live, non-bidirectional) Gemini API usage such as one-shot `generateContent`, embeddings, image/video generation, or fine-tuning — use the `gemini-api` skill for those.

Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/google-cloud-skills-liveapi-service/SKILL.md

Setup guide →

Signing

SignedSLSA L2
Signed by
skills-hub.ai distributor
Method
Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
Key
skills-hub-ed25519-2026-11
Signed
0Save

Instructions

LiveAPI Service Skill

This skill provides instructions for generating a LiveAPI client service
class
that connects to the Gemini Enterprise Live API over WebSockets. The
generated client handles bidirectional streaming, bearer-token authentication
via Application Default Credentials (ADC), transparent session resumption, and
ClientMessage / ServerMessage proto exchange.

The skill also produces a demo frontend + backend service so the user can
interactively validate the generated client (text, audio, video, transcription,
and interrupt handling).

Prerequisites

Before running the generation flow, ensure the following are available on the
host:

  • A Google Cloud project with the Vertex AI / Gemini Enterprise Agent Platform
    APIs enabled.

  • Application Default Credentials configured on the host running the generated
    client:

    gcloud auth application-default login
    
  • A destination output folder supplied by the user (e.g. /tmp/liveapi_out)
    where the generated code, environment, and demo will be written. Never
    mutate the host's system Python environment.

  • The user's chosen implementation language (Python is the default and
    reference language for this skill).

Reference Files

Provided files in references/ (do not treat these as standalone skills —
they are loaded on demand):

  • client_server_messages.md: Public reference for the ClientMessage /
    ServerMessage schemas used by the Live API.
  • client_server_messages.proto: The proto definition generated from
    client_server_messages.md.
  • session_manager.md: Describes how to correctly handle sessions, buffering,
    and resumption on disconnection.

Steps

Step 1: Copy the reference files

Copy client_server_messages.md, client_server_messages.proto, and
session_manager.md from this skill's references/ folder into the user's
destination output folder. These files become the source of truth for the
generated client.

Step 2: Reconcile with the public documentation

Examine the public documents linked from client_server_messages.md. If there
are any discrepancies between the public documents and the copied
client_server_messages.md / client_server_messages.proto, update the copies
in the destination folder so the generated client compiles and runs against the
current server contract.

Step 3: Implement the client class

Implement a class in the user's chosen language that:

  • Imports the local client_server_messages.proto types (ClientMessage,
    ServerMessage).
  • Opens a WebSocket connection to the Live API endpoint.
  • Exposes async methods so the user can send and receive data to/from the
    model.

For languages that require an isolated runtime (e.g. Python), create an isolated
environment (e.g. venv) inside the destination folder and generate a bash
script (e.g. setup.sh) that recreates the environment and installs
dependencies. Never install into the system interpreter or the user's global
site-packages, and never instruct the user to run sudo pip install.

Initialization parameters

The user provides the following at construction time:

  • project_id
  • location
  • model_id
  • config: a ClientMessage with the setup field populated.

Authentication

Obtain a bearer token via Application Default Credentials, attach it to the
WebSocket connect request as Authorization: Bearer <token>, refresh the token
before or upon expiry, and reuse the refreshed token on every reconnection
(including go_away and unexpected disconnects). Do not hard-code a
long-lived API key as the only auth mechanism.

Public async API

The class MUST expose the following async methods, gated on receipt of a
setup_complete ServerMessage before sending:

  • send_realtime_data(data): send realtime input. data is a ClientMessage
    carrying a realtime_input field.
  • send_client_content(data): send non-realtime, turn-based content that
    contributes to history. data is a ClientMessage carrying a
    client_content field.
  • receive(): yield ServerMessage instances parsed from the WebSocket
    stream.

Do not expose synchronous blocking variants as the primary API surface.

Step 4: Write a test file

Once the client is implemented, generate a test file that initializes the
connection and exercises sending text, audio, and video data and receiving
the responses. Ask the user for any information required to run the test
(project, model, media samples).

Step 5: Generate how_to_run.md

Provide a how_to_run.md in the destination folder that documents the generated
class. Include full examples showing how to build ClientMessage payloads for
every supported modality, how to send them, and how to receive data from the
model.

Step 6: Generate a demo frontend + backend service

Create scripts that deploy the implementation as a service with both a frontend
UI and a backend service (any language). The service MUST reuse the
ClientMessage / ServerMessage protos from Step 1 for wire traffic. Through
the UI the user should be able to:

  • Start a new connection / close the current connection.
  • Select the model to use.
  • Select input sources (audio and/or video from camera or screenshot) and
    stream them to the model.
  • Send a text message to the model.
  • Hear model audio and see the interleaved model and user transcription /
    conversation history.

While implementing audio and transcription playback, follow the guidance in
Live API best practices.

Handling the interrupt signal

When a ServerMessage's server_content arrives with interrupted: true, the
UI MUST:

  • Ensure played audio and its corresponding transcription remain time-aligned.
  • Immediately stop the currently playing model audio and stop appending to the
    in-progress transcription bubble.
  • Clear the unplayed audio buffer and any pending unrendered transcription so
    stale content does not bleed into the next turn.
  • Start new chat bubbles for the next user and model turns.

Handling the transcription finished signal

For streamed input_transcription / output_transcription chunks, append to
the currently active bubble while finished is unset, and close that bubble and
start a fresh one when finished is observed. Route input_transcription text
to user-role bubbles and output_transcription text to model-role bubbles.

Step 7: Generate how_to_test_with_ui.md

Write how_to_test_with_ui.md describing how to launch and use the demo
service. It MUST include:

  • The exact shell command(s) or script invocation(s) to start the backend
    service.
  • The exact shell command(s) or script invocation(s) to start the frontend UI.
  • The host and port (e.g. http://localhost:PORT) the user should open in
    their browser.
  • How to start a session, select a model, choose input sources (mic, camera,
    screen), send a text message, and observe model audio and transcription in
    the UI.

Validation Checklist

Before considering the generation complete, verify each item:

  • client_server_messages.md, client_server_messages.proto, and
    session_manager.md were copied into the destination folder.
  • The generated client imports the local proto-generated ClientMessage
    and ServerMessage types.
  • The client connects to the Live API WebSocket at
    wss://{location}-aiplatform.googleapis.com/ws/google.cloud.aiplatform.v1beta1.LlmBidiService/BidiGenerateContent
    (or the wss://aiplatform.googleapis.com/... global variant), and formats
    the setup model field as
    projects/{project_id}/locations/{location}/publishers/google/models/{model_id}.
  • Authentication uses ADC-provided bearer tokens sent as Authorization: Bearer <token>, is refreshed before expiry, and reattached on every
    reconnect.
  • Public async methods send_realtime_data, send_client_content, and
    receive are present, correctly typed, and gated on setup_complete.
  • Transparent session resumption is enabled
    (session_resumption.transparent = true), the latest new_handle is
    tracked, sent-message indexing starts at 1, the buffer is pruned via
    last_consumed_client_message_index, and buffered messages are replayed on
    reconnect (including on go_away and WebSocket close codes 1000 / 1006).
  • If using python, an isolated environment (e.g. venv) plus a setup.sh
    and requirements.txt (or equivalent) exist inside the destination folder;
    no changes were made to system or user-global Python.
  • how_to_run.md and how_to_test_with_ui.md are present, and the demo
    UI reuses the same ClientMessage / ServerMessage protos.
  • Interrupt handling and transcription finished handling behave as
    described above.
  • The client does not target generativelanguage.googleapis.com and
    does not authenticate via API key in a query string.
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
gke-manifest-generationGenerates and updates secure, production-ready Kubernetes YAML manifests optimized for GKE Autopilot and GKE Standard clusters. Use when creating or modifying GKE deployment manifests, configuring container security contexts, setting CPU/memory resource limits, defining readiness/liveness/startup probes, mounting secrets and volumes, configuring GKE Gateway API routes, targeting Spot VMs, or deploying AI model inference workloads (vLLM, TGI, Gemma). Don't use for live cluster operations, pod troubleshooting (use gke-workload-troubleshooting), or cluster infrastructure provisioning (use gke-cluster-creation).2 installsgoogle-analytics-admin-api-basicsManages Google Analytics account and property settings, enables the Analytics Admin API via the Cloud CLI, lists accounts and properties, and manages data streams, custom dimensions, conversion events, and integrations. Use when you need to programmatically configure Google Analytics accounts, provision properties, manage data retention, configure Measurement Protocol secrets, or manage Firebase and Google Ads links.1 installsgoogle-cloud-waf-cost-optimizationEvaluates Google Cloud workloads for cost efficiency and FinOps alignment using the Google Cloud Well-Architected Framework Cost Optimization pillar. Use when the user asks to analyze Google Cloud spend, reduce cloud bills, rightsize resources (for example, Compute, GKE, Storage, Databases), evaluate discount options (for example, CUDs, SUDs, Spot VMs), or eliminate idle capacity. Do not use for standalone product pricing lookups or non-cost architecture design.1 installsassured-workloads-basicsProvisions, inspects, updates, and deletes Google Cloud Assured Workloads V1 compliant folders, CMEK settings, Sovereign Controls by Partners, and service usage restrictions. Use when creating, listing, describing, updating, or deleting an Assured Workloads workload for any compliance regime or data boundary (FedRAMP, DoD IL2/IL4/IL5, ITAR, CJIS, Healthcare, Sovereign Controls by Partners, or Regional Data Boundaries). Don't use for brownfield assessments or custom frameworks (use assuredworkloads-environment-assessor or assuredworkloads-frameworks-*), or non-compliant folders.1 installsgoogle-cloud-solution-rag-enterprise-search-gke-sqldbDiscovers requirements, and generates architectural, design, and deployment guidance for a retrieval-augmented generation (RAG)-capable enterprise search system in Google Cloud. Use when users need a vector-enabled SQL database as the store and index for the embedding vectors, an open model and open-source inferencing framework, and Kubernetes containers to host all the application components. DON'T use this skill for fully-managed RAG, or SaaS search services, or when a non-SQL vector database is required.1 installsfirebase-basicsProvides foundational Firebase CLI setup, CLI installation, version checks (`firebase-tools@latest --version`), CLI login (including --no-localhost), project creation, project selection (`firebase use`), and app config file downloads (`google-services.json`, `GoogleService-Info.plist`). Use ONLY for CLI login, project creation/switching, or downloading app config files. Don't use for Firebase Hosting deploy, Firestore, Auth, App Hosting, Data Connect, Crashlytics, or Remote Config.1 installs

More from Google Cloud Skills

View source →
google-ads-api-mcp-setupGuides developers through downloading, configuring, and installing the official open-source Google Ads MCP Server. Use this skill when a user wants to connect their AI assistant (such as Gemini, Claude Code, or Cursor) to their Google Ads account to query campaigns or retrieve reporting metrics using natural language.4 installsspanner-basicsAssists in provisioning instances and databases, designing performant schemas, and querying data in Cloud Spanner on Google Cloud. Use when designing primary keys, writing SQL queries or client library code, or diagnosing performance issues.4 installsgke-workload-securityAudits, configures, and hardens workload-level security controls for Google Kubernetes Engine (GKE) applications and namespaces. Covers running security audits (`audit_cluster.sh`), enforcing Network Policies (default-deny and Dataplane V2 logging), isolating high-risk pods inside GKE Sandbox (`gVisor`), enforcing Pod Security Standards (`restricted` labeling) and pod securityContext, and mounting Secret Manager secrets via CSI (`SecretProviderClass`). Use when auditing workload security posture, isolating namespaces, applying pod security standards, or configuring network policies and secret volume mounts. Don't use for Workload Identity (use gke-workload-identity), cluster-wide control plane security, RBAC hardening, Binary Authorization, Shielded Nodes, or enabling platform-level GKE add-ons (use gke-platform-security instead).3 installsgke-upgradesPlans, executes, and validates Google Kubernetes Engine (GKE) cluster upgrades and maintenance operations for both Standard and Autopilot clusters. Produces upgrade plans, pre/post-upgrade checklists, maintenance runbooks with gcloud commands, release channel strategy, and troubleshooting guides. Handles node pool upgrade strategies (surge, blue-green), version compatibility, PDB management, and workload-specific concerns (stateful, GPU, operators). Use this skill whenever the user mentions GKE upgrades, Kubernetes version bumps, node pool maintenance, GKE patching, cluster version management, release channel selection, maintenance windows, surge upgrades, stuck upgrades, or any GKE lifecycle management task — even casual mentions like "we need to upgrade our clusters" or "plan our next GKE maintenance" or "our upgrade is stuck." Don't use for GKE cluster creation, application onboarding, general networking/routing setup, or security policy configurations (use gke-basics or relevant GK2 installsgoogle-cloud-recipe-networking-observabilityInvestigates Google Cloud networking issues by analyzing logs, metrics, and diagnostics. Use when investigating VPC Flow Logs, NAT, firewall, or threat logs, querying latency and throughput metrics, or running Connectivity Tests for path diagnostics.2 installsmigrate-to-rustClones, analyzes, plans, and migrates legacy codebases (C++, Fortran, Java, Python, C, Shell) from a GitHub URL or local directory to a modern, high-performance, deterministic, 100% Safe Rust architecture, tracking live telemetry across every task bucket, test failure/fix cycle, and Profile-Guided Optimization (PGO) stage, and producing a first-person AI storytelling report and interactive HTML infographic. Use when migrating a GitHub repository or local codebase to Rust, porting legacy C++, Fortran, Python, or Java workloads to memory-safe Rust, designing Struct-of-Arrays (SoA) or SIMD Rust architectures, or optimizing Rust ports with LLVM PGO. Don't use for unrelated non-Rust refactoring or single-line syntax questions.2 installs

More Build skills

Browse category →
senior-frontendBuild and review React, Next.js, TypeScript or Tailwind frontends: components, scaffolding, performance and bundle size. Use whenever the user wants a new component or app, a page feels slow, the bundle is too big, or asks for a frontend code review.653 installsui-design-systemUse when building a design system: tokens, component docs, responsive scales or developer handoff. Generates tokens with design_token_generator.py.553 installsfrontend-designGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.365 installssenior-backendBuild and fix backend services: REST or GraphQL APIs, auth, microservices, PostgreSQL queries, migrations and load tests. Use whenever the user's API is slow or broken, needs login or auth added, a schema change, or a new endpoint or service scaffolded.266 installsself-improving-agentCurate what the agent has learned into durable project knowledge. Reviews Claude Code auto-memory (MEMORY.md and its topic files) for learnings worth keeping, promotes proven ones into CLAUDE.md or .claude/rules/, records a correction as a lesson that persists across sessions, prunes stale or duplicate entries, and turns a recurring fix into a reusable skill. Use whenever the user asks what you have learned or saved about the project, which memories should become permanent rules, to remember a lesson or stop repeating a mistake, or to clean up, audit or check memory health.185 installsusing-superpowersUse when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions149 installs

Frequently asked questions about liveapi-service

What does the liveapi-service skill do?

Generates a LiveAPI client service class in the user's chosen programming language. Use when the user wants to build, scaffold, or integrate a client that connects to the Gemini Enterprise LiveAPI websocket endpoint, handles session setup/resumption, bearer token refresh, and sending/receiving `ClientMessage`/`ServerMessage` protos. Don't use for general (non-live, non-bidirectional) Gemini API usage such as one-shot `generateContent`, embeddings, image/video generation, or fine-tuning — use the `gemini-api` skill for those. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the liveapi-service skill?

Run `npx @skills-hub-ai/cli install google-cloud-skills-liveapi-service` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/google-cloud-skills-liveapi-service/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does liveapi-service work with?

liveapi-service runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the liveapi-service skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use liveapi-service after installing it?

In Claude Code, type `/google-cloud-skills-liveapi-service` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the liveapi-service skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.