ai-gateway
Internal service reference for centralized AI capability routing.
Install
mkdir -p .claude/skills/ai-gateway && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13288" && unzip -o skill.zip -d .claude/skills/ai-gateway && rm skill.zipInstalls to .claude/skills/ai-gateway
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Reference for the studio/ai-gateway service — the single shared entry point every other service uses to reach Claude, Gemini, and MiniMax. Use this when any service needs a new AI capability, when adding/editing system prompts or tool definitions, or when changing which provider handles which task.Key capabilities
- →Route chat requests to Claude
- →Translate text using MiniMax
- →Transcribe audio using Gemini
- →Convert text to speech using MiniMax or Chatterbox
- →Manage system prompts for different contexts
- →Log AI request costs
How it works
The AI Gateway acts as a single entry point for all AI capabilities, routing requests to specific providers like Claude, Gemini, or MiniMax based on the endpoint and context. It manages system prompts and logs usage for each request.
Inputs & outputs
When to use ai-gateway
- →Integrating new AI features
- →Editing system prompts
- →Changing AI providers
About this skill
AI Gateway — Reference
Purpose
One internal service that all other services call for any AI capability. No service (store, bots, dubbing) holds an AI provider API key or calls Claude/Gemini/MiniMax directly. This is what makes "swap providers" or "add logging" a one-place change instead of a three-place change.
Endpoints
POST /ai/chat
{
"context": "store-chat | store-admin | telegram-fb-ig-dm | fb-ig-comment",
"message": "user's message",
"history": [ /* prior turns, optional */ ]
}
contextselects the system prompt AND, forstore-admin, the available tools (seemedusa-storeskill for the tool list)- Routes to Claude (this is the default chat/agent provider)
- Returns
{ reply, tool_calls?: [...] }
POST /ai/translate
{
"context": "dubbing-sorani-to-iraqi",
"text": "chunk text",
"duration_seconds": 3.2
}
- Routes to MiniMax (see
video-dubbingskill for the prompt spec)
POST /ai/transcribe
{ "audio_url": "...", "language_hint": "ku" }
- Routes to Gemini for Sorani ASR
- Returns
{ chunks: [{ text, start_time, end_time }] }
POST /ai/tts
{ "text": "...", "voice": "iraqi-arabic-default", "provider": "minimax | chatterbox" }
providerdefaults tominimax; switch tochatterboxonce self-hosted (seevideo-dubbingskill)
System Prompt Registry
Each context value maps to one system prompt, stored as a separate file under studio/ai-gateway/prompts/<context>.md — never inline in code, so non-developers (and other agents) can review/edit prompts without touching application code.
| Context | Used by | Contains |
|---|---|---|
store-chat | Store widget | Product catalog, FAQ, store policies (Arabic) |
store-admin | Store admin agent | Tool definitions + Arabic admin persona |
telegram-fb-ig-dm | Bot Bridge | Store knowledge + conversational DM persona |
fb-ig-comment | Comment Bot | Shorter, public brand-voice persona |
dubbing-sorani-to-iraqi | Dubbing, step 2 | Dialect/register translation spec |
Cost Logging (mandatory)
Every request to this service writes one row to the ai_requests or ai_usage_logs table (Supabase): { timestamp, context, provider, model, input_tokens, output_tokens, estimated_cost }. This is the FIRST place the debugger agent should look for any AI-related issue — it shows exactly what was sent/received and what it cost, across every service.
Adding a New AI Capability
- Does an existing endpoint cover it? (most "new AI features" are just a new
contextvalue on/ai/chat) - If genuinely new, add an endpoint here — never let another service call a provider directly, even "just this once"
- Add the system prompt file under
studio/ai-gateway/prompts/ - Add cost logging for the new call path
- Update the table above
When not to use it
- →When a service needs to call an AI provider directly
- →When adding a new AI capability that is not genuinely new
Limitations
- →The skill only supports the defined endpoints and AI providers
- →New AI capabilities require adding an endpoint and system prompt
- →System prompts are stored as separate files and not inline in code
How it compares
This service centralizes AI provider access and configuration, allowing for system-wide changes and consistent logging, unlike individual services managing their own AI integrations.
Compared to similar skills
ai-gateway side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| ai-gateway (this skill) | 0 | 1mo | No flags | Intermediate |
| openrouter | 19 | 9mo | Review | Intermediate |
| langchain-architecture | 8 | 2mo | Review | Intermediate |
| ai-sdk | 11 | 2mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
openrouter
rawveg
OpenRouter API - Unified access to 400+ AI models through one API
langchain-architecture
wshobson
Design LLM applications using the LangChain framework with agents, memory, and tool integration patterns. Use when building LangChain applications, implementing AI agents, or creating complex LLM workflows.
ai-sdk
vercel
Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".
voice-ai-development
davila7
Expert in building voice AI applications - from real-time voice agents to voice-enabled apps. Covers OpenAI Realtime API, Vapi for voice agents, Deepgram for transcription, ElevenLabs for synthesis, LiveKit for real-time infrastructure, and WebRTC fundamentals. Knows how to build low-latency, production-ready voice experiences. Use when: voice ai, voice agent, speech to text, text to speech, realtime voice.
python-sdk
comet-ml
Python SDK patterns for Opik. Use when working in sdks/python, on SDK APIs, integrations, or message processing.
openrouter-fallback-config
jeremylongshore
Configure model fallback chains for high availability. Use when building fault-tolerant LLM systems. Trigger with phrases like 'openrouter fallback', 'openrouter backup model', 'openrouter redundancy', 'model failover'.