Memory

RouterBase Model Routing

Try it

Choose RouterBase model IDs and routing strategies for chat, image, video, audio, and embeddings workloads. Use when comparing providers, selecting GPT, Clau...

What it does

Choose RouterBase model IDs and routing strategies for chat, image, video, audio, and embeddings workloads. Use when comparing providers, selecting GPT, Clau...

The skill document

RouterBase Model Routing

Overview

Use routerbase to pick and document model choices behind one API key and one OpenAI-compatible integration surface. This skill helps agents turn workload requirements into a practical model shortlist, fallback plan, and validation checklist.

Read references/routerbase-models.md when exact catalog API calls, model examples, or selection heuristics are needed.

Routing Workflow

  1. Classify the task modality: chat, image, video, audio, embeddings, or mixed.
  2. Identify hard constraints: quality target, latency budget, price ceiling, context length, tool calling, vision, JSON mode, region/compliance needs, and fallback tolerance.
  3. Query the live RouterBase catalog when possible:
curl "https://routerbase.com/api/v1/models?task=chat" \
  -H "Authorization: Bearer $ROUTERBASE_API_KEY"
  1. Shortlist one primary model and one or two fallback models. Prefer fallbacks with the same modality and similar capability shape.
  2. Check current pricing before final recommendations:
curl "https://routerbase.com/api/v1/pricing" \
  -H "Authorization: Bearer $ROUTERBASE_API_KEY"
  1. Document the decision as a table: use case, primary model, fallback model, reason, validation test, and known caveats.

Selection Heuristics

  • For general chat, prefer a balanced fast model first, then escalate only when reasoning quality or context length requires it.
  • For high-stakes reasoning, choose a flagship model and require human review of outputs.
  • For latency-sensitive UX, prefer smaller or flash-tier models and keep prompts compact.
  • For tool-heavy agents, choose chat models documented to support tool calling and test the exact tool schema.
  • For JSON outputs, use response_format where the selected model supports JSON mode, and add schema validation in application code.
  • For prompt caching benefits, place stable system prompts, policies, and tool definitions before variable user content.
  • For media workflows, keep routing separate by modality; image, video, and audio endpoints have different sync/async behavior.

Fallback Design

Use explicit application-level fallback logic unless the user has configured RouterBase's smart routing in their account or upstream settings.

const modelPlan = [
  "anthropic/claude-sonnet-4-6",
  "google/gemini-2.5-flash",
];

for (const model of modelPlan) {
  try {
    return await client.chat.completions.create({ model, messages });
  } catch (error) {
    if (!isRetryableRouterBaseError(error)) throw error;
  }
}

Classify retryable errors conservatively: transient network failures, timeouts, 429, and 5xx are reasonable candidates; auth errors, invalid model IDs, validation errors, and policy errors should not be retried blindly.

Recommendation Format

When recommending a routing plan, include:

  • Primary model and why it fits.
  • Fallback model and what tradeoff it makes.
  • Current catalog/pricing check status.
  • Any feature assumptions that must be tested, such as tool calling, vision, JSON mode, context size, prompt caching, or streaming.
  • A minimal eval prompt or request fixture the user can run before production.

Avoid pretending prices or supported model IDs are permanent. RouterBase's docs explicitly describe the model and pricing catalog as changing with upstream providers.

Related skills

Integrate applications with RouterBase, the OpenAI-compatible model gateway at https://routerbase.com/v1. Use when migrating OpenAI SDK calls to RouterBase,...

Build image, video, and audio generation workflows on RouterBase. Use when calling RouterBase image, video, audio, speech, or media APIs; selecting media mod...

Smart LLM Router for OpenClaw. Save up to 70% by routing every request to the right model. No coding required.

13 installs

Quota-aware LLM router that squeezes maximum usable AI out of free-tier API keys across Gemini, Mistral, OpenRouter, Kilo and Cerebras plus any OpenAI-compatible endpoint (including local Ollama/llama.cpp/vLLM). Probes every model on every key, measures real quality and real published rate limits, then routes each request to the cheapest model that can do the job — spending abundant capacity first and reserving scarce daily quota for when it is actually needed. Persists cooldowns to disk so a 429 discovered in one process is respected by the next. Use when an agent must make many LLM calls on free keys without hitting rate limits, when "all models failed", or when deciding which of several provider keys to use for a task.

2 installs

智能模型路由与Token成本优化顾问 / Smart LLM Router & Token Cost Optimizer. 帮助用户为不同复杂度的AI任务选择最合适的模型层级(从极致性价比到旗舰级), 通过任务复杂度评估、模型分级推荐、安全强制升级规则,在保证质量的前提下节省70-90%的Token成本。 同时提...

LangGraph task router for OpenClaw that decomposes complex work into dependency-aware subtasks, routes each branch to PRO or FLASH models, retries or escalat...

16 installs1 stars