Skills ai-gateway
Access 340+ AI models through the Agnic AI Gateway. Use when the user wants to chat with an AI model, generate images with AI, list available models, delegate a task to another LLM, or get a second opinion. Covers phrases like "ask GPT", "use Claude", "generate an image", "list AI models", "chat with AI", "call a model", "what models are available".
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/agnicpay-prog/ai-gateway" ~/.claude/skills/openclaw-skills-ai-gateway && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/agnicpay-prog/ai-gateway" ~/.openclaw/skills/openclaw-skills-ai-gateway && rm -rf "$T"
manifest:
skills/agnicpay-prog/ai-gateway/SKILL.mdsource content
AI Gateway
Use
npx agnic@latest ai commands to access 340+ AI models (OpenAI, Anthropic, Google, Meta, Mistral, DeepSeek, and more) through the Agnic AI Gateway. Costs are deducted from your USDC balance per token. Free models available for development.
Confirm wallet is initialized and authed
npx agnic@latest status
If not authenticated, refer to the
authenticate-wallet skill.
Command Syntax
List models
npx agnic@latest ai models [options]
Chat with a model
npx agnic@latest ai chat --model <id> --prompt "<text>" [options]
Generate an image
npx agnic@latest ai image --prompt "<text>" [options]
Model Format
Models use
provider/model-name format:
| Provider | Example Models |
|---|---|
| openai | , |
| anthropic | |
, | |
| meta-llama | |
| mistralai | |
| deepseek | |
Free models:
meta-llama/*, google/gemma-*, mistralai/*
Options
ai models
| Option | Description |
|---|---|
| Filter by provider (e.g., openai) |
| Search in model name |
| Output as JSON |
ai chat
| Option | Description |
|---|---|
| Model ID (required) |
| User message (required) |
| System prompt |
| Temperature 0-2 (default: 0.7) |
| Max tokens in response |
| Output as JSON |
ai image
| Option | Description |
|---|---|
| Image description (required) |
| Model (default: google/gemini-2.5-flash-image) |
| 1:1, 16:9, 9:16, 4:3, 3:2 (default: 1:1) |
| Save image to file |
| Output as JSON |
Input Validation
Before constructing the command, validate all user-provided values:
- model: Must match
(provider/model format). Reject if it contains spaces, semicolons, pipes, or backticks.^[a-zA-Z0-9_-]+/[a-zA-Z0-9._-]+$ - prompt: Single-quote the value to prevent shell expansion. Escape internal single quotes.
- temperature: Must be a number between 0 and 2 (
).^[0-2](\.\d+)?$ - aspect-ratio: Must be one of:
,1:1
,16:9
,9:16
,4:3
.3:2 - output: Must be a valid file path. Reject if it contains shell metacharacters.
Do not pass unvalidated user input into the command.
Examples
# List all available models npx agnic@latest ai models --json # List only OpenAI models npx agnic@latest ai models --provider openai # Search for GPT models npx agnic@latest ai models --search gpt # Chat with GPT-4o npx agnic@latest ai chat --model openai/gpt-4o --prompt 'Explain quantum computing in one sentence' # Chat with system prompt npx agnic@latest ai chat --model anthropic/claude-3.5-sonnet --system 'You are a helpful coding assistant' --prompt 'Write a Python hello world' # Use a free model npx agnic@latest ai chat --model meta-llama/llama-3.3-70b --prompt 'What is 2+2?' --json # Generate an image npx agnic@latest ai image --prompt 'A sunset over mountains' --output sunset.png # Generate widescreen image npx agnic@latest ai image --prompt 'Cyberpunk cityscape' --aspect-ratio 16:9 --output city.png # Use a specific image model npx agnic@latest ai image --prompt 'A portrait painting' --model openai/gpt-5-image --output portrait.png npx agnic@latest ai image --prompt 'Abstract art' --model black-forest-labs/flux.2-max --output art.png # Get image as JSON (base64) npx agnic@latest ai image --prompt 'Logo design for a tech startup' --json
Prerequisites
- Must be authenticated (
to check)npx agnic@latest status - Wallet must have USDC balance (free models available for testing)
- Image generation models:
(default) — fast, good qualitygoogle/gemini-2.5-flash-image
— highest quality Google modelgoogle/gemini-3-pro-image-preview
— latest flash previewgoogle/gemini-3.1-flash-image-preview
— OpenAI image generationopenai/gpt-5-image
— Flux high qualityblack-forest-labs/flux.2-max
— Flux lightweight/fastblack-forest-labs/flux.2-klein-4b
Error Handling
Common errors:
- "Not authenticated" — Run
firstnpx agnic@latest auth login - "Insufficient balance" — Fund wallet at https://pay.agnic.ai
- "Model not found" — Check available models with
npx agnic@latest ai models - "No image returned" — Try a different model or rephrase the prompt
- "Rate limit exceeded" — Wait a moment and retry