TokenLab OpenAI-Compatible Migration for Openclaw

Openclaw Skills for migrating OpenAI-compatible apps to TokenLab with minimal code changes, live model discovery, and preserved request semantics.

hedging8563
v1.0.0
Jul 10, 2026
0
465
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install tokenlab-openai-compatible-migration

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install tokenlab-openai-compatible-migration using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is TokenLab OpenAI-Compatible Migration?

TokenLab OpenAI-Compatible Migration is an Openclaw Skills workflow for moving OpenAI-compatible apps, SDKs, examples, and environment variables to TokenLab with the smallest possible diff. It preserves request semantics, keeps the existing client shape intact, and swaps in the correct TokenLab base URL, API key, and model lookup path without forcing a rewrite.

When the source integration depends on native provider behavior, the skill preserves that behavior with the right TokenLab endpoint for Responses, Anthropic Messages, Gemini content generation, media, audio, embeddings, rerank, or translation. It also adds live model discovery and a rollback path so Openclaw Skills users can migrate safely, verify compatibility, and revert instantly if needed.

TokenLab OpenAI-Compatible Migration Use Cases

  • Migrating OpenAI SDK apps from an existing compatible provider to TokenLab with minimal code or config changes.
  • Repointing OpenRouter, LiteLLM, LangChain, or LlamaIndex integrations to TokenLab while keeping the current request flow intact.
  • Replacing hardcoded provider model slugs with live TokenLab discovery results before shipping.
  • Preserving native Anthropic or Gemini semantics when the app uses messages, content parts, tools, media, or audio.
  • Moving embeddings, rerank, or translation workloads family-by-family instead of flattening them into generic chat.
  • Producing a smoke test and rollback note for production-safe migration and quick recovery.

How TokenLab OpenAI-Compatible Migration Works

  1. Inspect the current provider configuration, environment variables, model IDs, and any provider-specific headers.
  2. Classify the integration as OpenAI-compatible, Anthropic-native, Gemini-native, or a mixed setup with separate endpoint families.
  3. Apply the smallest possible change first: swap the base URL, replace the API key variable, and keep the existing SDK or client shape intact.
  4. Add live model discovery only where the app currently hardcodes provider-specific models, using TokenLab catalog endpoints to map safe replacements.
  5. Preserve native semantics when the app uses Responses, Anthropic Messages, Gemini generateContent, media, audio, embeddings, rerank, or translation behaviors.
  6. Validate the migrated path with a smoke test, then include a rollback line that restores the previous base URL and environment variables.

TokenLab OpenAI-Compatible Migration Setup

  1. Set the TokenLab API key in your shell or deployment environment.
  2. Update the existing provider base URL in your app config instead of rewriting the SDK.
  3. Use TokenLab's model discovery endpoint before replacing any hardcoded model slugs.
  4. Run a smoke test against the migrated endpoint and verify the response shape matches the original integration.
export TOKENLAB_API_KEY="your-tokenlab-api-key"
# OpenAI-compatible SDKs: https://api.tokenlab.sh/v1
# Anthropic-native clients: https://api.tokenlab.sh
# Gemini-native clients: https://api.tokenlab.sh
curl -H "Authorization: Bearer $TOKENLAB_API_KEY" \
  "https://api.tokenlab.sh/v1/models?recommended_for=chat"
curl https://api.tokenlab.sh/v1/chat/completions \
  -H "Authorization: Bearer $TOKENLAB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"<model-id>","messages":[{"role":"user","content":"ping"}]}'

TokenLab OpenAI-Compatible Migration Data Schema & Taxonomy

Generated migration artifacts

Artifact Type Contents Purpose
Focused diff or config block Markdown or code Base URL, auth header, and minimal client changes Preserve the existing request path with the smallest possible edit
Model discovery command Bash GET /v1/models, optional recommended_for query, and model detail lookup Replace hardcoded provider-specific model IDs safely
Smoke test command Bash One request through the migrated path Verify the TokenLab integration before rollout
Rollback note Plain text Previous base URL and previous environment variables Restore the old provider config quickly

Migration metadata taxonomy

  • migration_surface: OpenAI-compatible app, OpenRouter setup, LiteLLM config, LangChain/LlamaIndex app, custom SDK wrapper
  • provider_mode: OpenAI-compatible, Anthropic-native, Gemini-native
  • base_url: https://api.tokenlab.sh/v1 or https://api.tokenlab.sh
  • auth_header: Authorization: Bearer $TOKENLAB_API_KEY
  • endpoint_family: chat completions, messages, generateContent, models, embeddings, rerank, media, audio, translation
  • model_resolution: static model ID, live discovery, or recommended-for lookup
  • compatibility_notes: native payload requirements, provider-specific headers, semantic constraints
  • rollback: previous base URL and prior env vars

File handling

  • No persistent files are generated by default.
  • The skill usually returns migration-ready snippets, a smoke test, a discovery command, and a rollback line instead of creating new project files.

TokenLab OpenAI-Compatible Migration Advanced Features

  • Minimal-diff migration strategy that preserves the current SDK or client shape whenever a base URL swap is enough.
  • Live model discovery via /v1/models, /v1/models?recommended_for=<scene>, and /v1/models/:model for safe catalog-based remapping.
  • Native endpoint preservation for Anthropic Messages, Gemini generateContent, and Responses-style workflows.
  • Family-by-family migration for chat, embeddings, media, audio, rerank, and translation when one base URL is not enough.
  • OpenRouter slug mapping only after catalog lookup, avoiding blind model replacement.
  • Production-safe rollback guidance that restores the previous provider config, base URL, and environment variables.
  • Header hygiene that keeps only TokenLab-documented or still-required provider headers, reducing migration risk.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*