SuperAPI AI Directory

routerbase-api-integration-cn

Agents & models

View repository

Updated 10-16 08:44

About this skill

RouterBase API Integration

Overview

Use routerbase as an OpenAI-compatible model gateway to connect applications. This skill covers SDK migration, base URL configuration, streaming output, tool calling, JSON mode, vision input, request validation, error handling, and credential security.

When to Use

Use this skill when the user requests the following:

  • Migrate OpenAI-compatible SDK calls to RouterBase
  • Set base_url or baseURL to https://routerbase.com/v1
  • Securely configure the RouterBase API Key to avoid leaking the key
  • Implement chat completions, streaming output, tool calling, JSON mode, or vision input
  • Write RouterBase integration examples for clients such as Python, JavaScript, curl, LangChain, LlamaIndex, Vercel AI SDK, Cursor, and Continue

Do Not Use

This skill should not be used in the following scenarios:

  • Publishing, logging, or saving real API Keys
  • Guessing provider behavior that the user has not provided and that upstream documentation does not specify
  • Rewriting an existing working provider integration when the user only needs model selection advice

Usage Instructions

  1. Identify the client, language, model ID, and deployment environment the user is currently using.
  2. Preserve the existing OpenAI-compatible SDK as much as possible, changing only the base URL, model, and local key configuration.
  3. Use placeholders such as <ROUTERBASE_API_KEY> in examples.
  4. The API Key must remain on the server side or in a local secure environment and must not be written to git.
  5. Before suggesting large-scale changes, provide a small test request first.
  6. Output a validation checklist covering expected status codes, response structure, timeout handling, and log redaction requirements.