google-ai
Google Gemini API for Pro/Flash/Ultra models with 1M token context.
What this skill does
# google-ai
## Purpose
This skill enables interaction with Google's Gemini API, allowing access to Pro, Flash, and Ultra models for tasks like text generation, chat, and embedding with up to 1M token context. It's designed for integrating advanced AI capabilities into applications via RESTful endpoints.
## When to Use
Use this skill when you need large-context AI processing, such as summarizing long documents, generating code from detailed specs, or handling multi-turn conversations. Apply it in scenarios requiring Google-specific models, like when OpenAI alternatives are insufficient or when integrating with Google Cloud ecosystems.
## Key Capabilities
- Access Gemini Pro for general tasks, Flash for faster inference, and Ultra for complex reasoning.
- Handle contexts up to 1M tokens, ideal for processing books or codebases.
- Support multimodal inputs (text, images) via specific endpoints.
- Embeddings generation for semantic search, using models like text-embedding-004.
- Rate limiting and quotas managed per API key, with up to 1,000 requests per minute.
## Usage Patterns
Always initialize with authentication via the `$GOOGLE_API_KEY` environment variable. For OpenClaw, invoke this skill by prefixing commands with the skill ID, e.g., `google-ai generate`. Use JSON payloads for requests and handle responses as JSON objects. Pattern: Set up a request with model selection, then send via HTTP POST; parse the response for output. For repeated use, cache API responses to avoid rate limits.
## Common Commands/API
The primary endpoint is `https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent`. Use HTTP POST requests with a JSON body. For example:
```json
{
"contents": [{"parts": [{"text": "Write a function for sorting arrays"}]}]
}
```
CLI example: Run `curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $GOOGLE_API_KEY" -d '{"contents": [{"parts": [{"text": "Hello"}]}]}' https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent`. Common flags: `--model gemini-pro` for model selection, or `--max-tokens 1024` to limit output. For embeddings, use `https://generativelanguage.googleapis.com/v1beta/models/{model}:embedContent` with payload like:
```json
{
"model": "models/text-embedding-004",
"content": "Embed this text"
}
```
In OpenClaw, execute via `google-ai embed --text "Sample text" --model text-embedding-004`.
## Integration Notes
Set the `$GOOGLE_API_KEY` as an environment variable before use, e.g., `export GOOGLE_API_KEY=your_api_key`. In OpenClaw configs, add under [skills] section: `google-ai = { api_key = "$GOOGLE_API_KEY", default_model = "gemini-pro" }`. Ensure your project is enabled in Google Cloud Console under AI Studio. For asynchronous operations, use webhooks or polling; integrate with other skills by chaining outputs, e.g., pipe `google-ai` results to a search skill. Handle retries with exponential backoff for transient errors.
## Error Handling
Check HTTP status codes: 401 for invalid API key (re-authenticate using `$GOOGLE_API_KEY`), 429 for rate limits (wait and retry with a delay). Parse JSON errors for details, e.g., if "code": "INVALID_ARGUMENT", validate your request body. In OpenClaw, wrap commands in try-catch blocks: e.g., `try { execute "google-ai generate" } catch { log error and retry after 5 seconds }`. Always validate inputs to avoid 400 errors, such as ensuring model names match exactly (e.g., "gemini-1.0-pro").
## Concrete Usage Examples
1. Generate code: To create a Python function, use `google-ai generate --model gemini-pro --prompt "Write a function to merge two sorted lists"`. This sends a POST to the endpoint and returns the code snippet.
2. Embed text for search: For semantic similarity, run `google-ai embed --model text-embedding-004 --text "Example query"`, then compare embeddings in your application using cosine similarity.
## Graph Relationships
- Cluster: Connected to "ai-apis" for shared AI endpoint handling.
- Tags: Linked to "ai-apis" and "api" for discoverability in API-related skills.
- Related Skills: Integrates with "openai" for model comparisons; depends on "google-cloud" for authentication flows.
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.