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

Installs 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.
299 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

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

You give it
A JSON object specifying the AI capability and its parameters (e.g., chat message, text for translation, audio URL)
You get back
A JSON object containing the result (e.g., chat reply, translated text, transcription chunks, TTS audio)

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 */ ]
}
  • context selects the system prompt AND, for store-admin, the available tools (see medusa-store skill 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-dubbing skill 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" }
  • provider defaults to minimax; switch to chatterbox once self-hosted (see video-dubbing skill)

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.

ContextUsed byContains
store-chatStore widgetProduct catalog, FAQ, store policies (Arabic)
store-adminStore admin agentTool definitions + Arabic admin persona
telegram-fb-ig-dmBot BridgeStore knowledge + conversational DM persona
fb-ig-commentComment BotShorter, public brand-voice persona
dubbing-sorani-to-iraqiDubbing, step 2Dialect/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

  1. Does an existing endpoint cover it? (most "new AI features" are just a new context value on /ai/chat)
  2. If genuinely new, add an endpoint here — never let another service call a provider directly, even "just this once"
  3. Add the system prompt file under studio/ai-gateway/prompts/
  4. Add cost logging for the new call path
  5. 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.

SkillInstallsUpdatedSafetyDifficulty
ai-gateway (this skill)01moNo flagsIntermediate
openrouter199moReviewIntermediate
langchain-architecture82moReviewIntermediate
ai-sdk112moReviewAdvanced

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

19178

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.

899

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

1150

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.

553

python-sdk

comet-ml

Python SDK patterns for Opik. Use when working in sdks/python, on SDK APIs, integrations, or message processing.

426

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

221

Search skills

Search the agent skills registry