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".

3,891 stars

Best use case

ai-gateway is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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".

Teams using ai-gateway should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ai-gateway/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/agnicpay-prog/ai-gateway/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ai-gateway/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ai-gateway Compares

Feature / Agentai-gatewayStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# 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

```bash
npx agnic@latest status
```

If not authenticated, refer to the `authenticate-wallet` skill.

## Command Syntax

### List models

```bash
npx agnic@latest ai models [options]
```

### Chat with a model

```bash
npx agnic@latest ai chat --model <id> --prompt "<text>" [options]
```

### Generate an image

```bash
npx agnic@latest ai image --prompt "<text>" [options]
```

## Model Format

Models use `provider/model-name` format:

| Provider | Example Models |
| ----------- | ----------------------------------------- |
| openai | `openai/gpt-4o`, `openai/gpt-4-turbo` |
| anthropic | `anthropic/claude-3.5-sonnet` |
| google | `google/gemini-2.5-flash-image`, `google/gemma-*` |
| meta-llama | `meta-llama/llama-3.3-70b` |
| mistralai | `mistralai/mistral-large-latest` |
| deepseek | `deepseek/deepseek-chat` |

Free models: `meta-llama/*`, `google/gemma-*`, `mistralai/*`

## Options

### ai models

| Option | Description |
| -------------------- | ---------------------------------------- |
| `--provider <name>` | Filter by provider (e.g., openai) |
| `--search <term>` | Search in model name |
| `--json` | Output as JSON |

### ai chat

| Option | Description |
| ----------------------- | ---------------------------------------- |
| `--model <id>` | Model ID (required) |
| `--prompt <text>` | User message (required) |
| `--system <text>` | System prompt |
| `--temperature <n>` | Temperature 0-2 (default: 0.7) |
| `--max-tokens <n>` | Max tokens in response |
| `--json` | Output as JSON |

### ai image

| Option | Description |
| ------------------------- | ---------------------------------------- |
| `--prompt <text>` | Image description (required) |
| `--model <id>` | Model (default: google/gemini-2.5-flash-image) |
| `--aspect-ratio <ratio>` | 1:1, 16:9, 9:16, 4:3, 3:2 (default: 1:1)|
| `--output <path>` | Save image to file |
| `--json` | Output as JSON |

## Input Validation

Before constructing the command, validate all user-provided values:

- **model**: Must match `^[a-zA-Z0-9_-]+/[a-zA-Z0-9._-]+$` (provider/model format). Reject if it contains spaces, semicolons, pipes, or backticks.
- **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

```bash
# 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 (`npx agnic@latest status` to check)
- Wallet must have USDC balance (free models available for testing)
- Image generation models:
  - `google/gemini-2.5-flash-image` (default) — fast, good quality
  - `google/gemini-3-pro-image-preview` — highest quality Google model
  - `google/gemini-3.1-flash-image-preview` — latest flash preview
  - `openai/gpt-5-image` — OpenAI image generation
  - `black-forest-labs/flux.2-max` — Flux high quality
  - `black-forest-labs/flux.2-klein-4b` — Flux lightweight/fast

## Error Handling

Common errors:

- "Not authenticated" — Run `npx agnic@latest auth login` first
- "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

Related Skills

gateway-rescue

3891
from openclaw/skills

OpenClaw Gateway 看门狗,纯 systemd/launchd 原生管理。崩溃自动重启,连续失败3次停止等待人工介入。 支持:install(安装)、uninstall(卸载)、status(状态)、test(故障测试)。

Authensor Gateway

3891
from openclaw/skills

Fail-safe policy gate for OpenClaw marketplace skills. Intercepts tool calls before execution and checks them against your Authensor policy. Low-risk actions run automatically. High-risk actions require your approval. Dangerous actions are blocked. Only action metadata is sent to the control plane — never your files, API keys, or conversation content.

gateway-safety

3891
from openclaw/skills

Safely update OpenClaw gateway configuration (openclaw.json) with automatic validation, backup, and 30-second health-check rollback. Use this skill whenever an agent needs to modify gateway settings, ports, provider credentials, or network bindings to ensure the session is not permanently lost due to a bad configuration.

windows-healing-gateway

3891
from openclaw/skills

OpenClaw Gateway Self-Healing System for Windows

crebee-social-media-gateway

3891
from openclaw/skills

CreBee 社交媒体网关。当用户需要管理社交媒体账号、发布内容(视频/图文/文章)、获取数据分析、访问粉丝画像、搜索话题/活动/音乐、或与抖音、B站、小红书、快手等 12 个平台交互时触发此技能。适用于 AI Agent 自动化管理中国社交媒体平台运营。 触发场景: - 发布内容到社交媒体平台 - 获取账号列表或账号信息 - 查询分析数据、数据概览、表现指标 - 访问粉丝/观众画像 - 搜索话题、标签、音乐、活动 - 管理抖音、B站、小红书、快手等平台的内容

SKILL.md - Gateway Watchdog Skill

3891
from openclaw/skills

> 一句话让 OpenClaw 安装 Gateway Watchdog

SKILL.md - OpenClaw Gateway Watchdog

3891
from openclaw/skills

> 让你的 OpenClaw Gateway 7/24 稳定运行

---

3891
from openclaw/skills

name: article-factory-wechat

Content & Documentation

humanizer

3891
from openclaw/skills

Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.

Content & Documentation

find-skills

3891
from openclaw/skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

General Utilities

tavily-search

3891
from openclaw/skills

Use Tavily API for real-time web search and content extraction. Use when: user needs real-time web search results, research, or current information from the web. Requires Tavily API key.

Data & Research

baidu-search

3891
from openclaw/skills

Search the web using Baidu AI Search Engine (BDSE). Use for live information, documentation, or research topics.

Data & Research