afrouter
Skill8 starsChanged 3 months agoMITView on GitHub
Setup for AFRouter, a local or remote OpenAI-compatible AI gateway, plus an index of every capability skill. Use when the user mentions AFRouter or asks for AI capability routing without provider boilerplate.
In this repository11 other files it gives its agents.
- open-sse/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- afrouter-chatSkill
- afrouter-embeddingsSkill
- afrouter-imageSkill
- afrouter-sttSkill
- afrouter-systemoneSkill
- afrouter-ttsSkill
- afrouter-videoSkill
- afrouter-web-fetchSkill
- afrouter-web-searchSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 51
Use data[].id as the model field in requests.
- Very specific: line 65
When the user needs a specific capability, fetch that skill's SKILL.md from its raw URL:
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AFRouter
Local/remote AI gateway exposing OpenAI-compatible REST. One key, many providers, auto-fallback.
Base URL
Resolve the base URL once and use it everywhere:
BASE="${AFROUTER_URL:-http://localhost:20128}"AFROUTER_URL is a convenience variable for these skills, not a gateway setting. Set it to reach a remote VPS or tunnel gateway; when it is unset, $BASE is http://localhost:20128. The CLI launcher reaches the same gateway through AFROUTER_HOST (default 127.0.0.1) and AFROUTER_PORT (default 20128).
Auth
Send the API key on every request:
export AFROUTER_KEY="sk_afrouter..." # create in Dashboard → Keys
curl -s "$BASE/v1/models" -H "Authorization: Bearer $AFROUTER_KEY"AFRouter ships with requireApiKey: true, so a request without the header returns 401 Missing API key. The gateway skips the key check only when the operator turns requireApiKey off (Dashboard → Endpoint).
Verify
curl -s "$BASE/api/health" # → {"ok":true}/api/health serves without auth, so it confirms the gateway is up before you debug keys.
Discover models
curl -s "$BASE/v1/models" -H "Authorization: Bearer $AFROUTER_KEY" # chat/LLM (default)
curl -s "$BASE/v1/models/image" -H "Authorization: Bearer $AFROUTER_KEY" # image-gen
curl -s "$BASE/v1/models/tts" -H "Authorization: Bearer $AFROUTER_KEY" # text-to-speech
curl -s "$BASE/v1/models/embedding" -H "Authorization: Bearer $AFROUTER_KEY" # embeddings
curl -s "$BASE/v1/models/web" -H "Authorization: Bearer $AFROUTER_KEY" # web search + fetch (entries have `kind` field)
curl -s "$BASE/v1/models/stt" -H "Authorization: Bearer $AFROUTER_KEY" # speech-to-text
curl -s "$BASE/v1/models/image-to-text" -H "Authorization: Bearer $AFROUTER_KEY" # visionUse data[].id as the model field in requests. Combos appear with owned_by:"combo".
The catalog lists providers reachable through saved connections. Built-in no-auth providers (for example opencode, whose System One model is oc/jev-1.13-free) have no connection, so they are absent from this list and must be called by their exact id.
Response shape:
{ "object": "list", "data": [
{ "id": "openai/gpt-5", "object": "model", "owned_by": "openai", "created": 1735000000 },
{ "id": "tavily/search", "object": "model", "kind": "webSearch", "owned_by": "tavily", "created": 1735000000 }
]}Capability skills
When the user needs a specific capability, fetch that skill's SKILL.md from its raw URL:
Errors
401 Missing API key→ auth is on by default; sendAuthorization: Bearer $AFROUTER_KEY(Dashboard → Keys)ECONNREFUSEDonhttp://localhost:20128→ the gateway is not running; start it withnpm run devorafrouter400 Invalid model format→ checkmodelexists in/v1/models/<kind>503 All accounts unavailable→ waitretry-afteror add another provider account
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

