Add the FastRouter AI provider to OpenClaw with all available text and vision models using only built-in tools (no script execution required).
sk-v1- followed by a hex string. If not provided, ask for it.https://api.fastrouter.aiParse the API key from the user's message. It starts with sk-v1-.
If no API key is found, ask the user for it. Do NOT proceed without one.
Use web_fetch to get the model list:
web_fetch url="https://api.fastrouter.ai/v1/models" extractMode="text"
From the response JSON, keep only models where:
is_active is truearchitecture.output_modalities includes "text"architecture.input_modalities includes "text" or "image"For each qualifying model, extract:
id — the model identifiercontext_length — context window sizetop_provider.max_completion_tokens — max output tokens (if 0 or missing, use min(context_length, 8192))Construct the provider object (do NOT include a "name" key — OpenClaw rejects it):
{
"baseUrl": "https://api.fastrouter.ai",
"api": "openai-completions",
"apiKey": "THE_API_KEY",
"models": [
{
"id": "model/id",
"name": "Display Name",
"contextWindow": 128000,
"maxTokens": 8192,
"input": ["text", "image"],
"cost": {"input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0},
"reasoning": false
}
]
}
Use read to load ~/.openclaw/openclaw.json.
Merge the provider into models.providers.fastrouter, preserving all other config.
Also add model references to agents.defaults.models — for each model, add:
"fastrouter/MODEL_ID": {}
Use write to save the updated config.
openclaw gateway restart
This is the only step requiring user approval.
Tell the user:
/model fastrouter/MODEL_IDfastrouter共 1 个版本