
Byok Custom Model
Register your own LLM provider and API key so the agent talks to Anthropic, OpenAI, OpenRouter, xAI Grok, DeepSeek, Qwen, or self-hosted endpoints without the platform proxy.
Overview
BYOK Custom Model is an agent skill for the Build phase that registers a bring-your-own-key custom LLM endpoint in the model selector using provider API examples and script exports.
Install
npx skills add https://github.com/starchild-ai-agent/official-skills --skill byok-custom-modelWhat is this skill?
- Script-mode BYOK skill—run parse_example and add from bash exports without extra tool registration
- API-example-first onboarding: paste official curl/docs sample (no real key) to auto-detect base_url, upstream_model, and
- Supports OpenAI vs Anthropic wire detection plus vendor fields such as thinking params
- Covers major providers and aggregators including OpenRouter, Anthropic, OpenAI, xAI Grok, DeepSeek, Qwen, Kimi, Gemini,
- Bypasses platform proxy so your key hits the vendor or aggregator directly
- Script-mode skill version 2.1.0 with API-example-first onboarding flow
- parse_example auto-detects base_url, upstream_model, wire format, and thinking params
Adoption & trust: 1.3k installs on skills.sh; 13 GitHub stars; 2/3 security scanners passed (skills.sh audits); trending (+200% hot-view momentum).
What problem does it solve?
You have a vendor API key and docs example but no reliable way to register the endpoint wire format in your agent’s model list.
Who is it for?
Indie builders standardizing on OpenRouter, native Anthropic/OpenAI keys, Grok, DeepSeek, Qwen, or self-hosted gateways inside Starchild-style agent hosts.
Skip if: Users who only need default platform models or ChatGPT/Codex OAuth—use chatgpt-codex-onboarding instead of BYOK.
When should I use this skill?
When you need to register a custom LLM endpoint (Anthropic, OpenAI, xAI Grok, Qwen, DeepSeek, Venice, OpenRouter, self-hosted, etc.) with your own API key.
What do I get? / Deliverables
Your custom model appears in the selector with parsed base URL, upstream model id, and correct OpenAI or Anthropic wire so the agent calls your key directly.
- Parsed draft config from parse_example
- Registered custom model entry via add or add_template
- Selectable BYOK model bypassing platform proxy
Recommended Skills
Journey fit
Custom model wiring is done while you configure the coding agent stack before day-to-day feature work. Agent-tooling covers model selectors, BYOK endpoints, and provider-specific request shapes—not application business logic.
How it compares
BYOK script registration with your API key—not the platform proxy and not OAuth Codex onboarding.
Common Questions / FAQ
Who is byok-custom-model for?
Solo builders and small teams wiring Starchild-class agents to their own LLM accounts, aggregators, or self-hosted inference.
When should I use byok-custom-model?
Use it in Build under agent-tooling when you need a new provider in the model dropdown—start by pasting the vendor’s API example, then run parse_example and add after review.
Is byok-custom-model safe to install?
It is marked protected and handles API keys locally; review Security Audits on this page and never paste production secrets into chat—use placeholders during parse_example.
SKILL.md
READMESKILL.md - Byok Custom Model
# 🔑 BYOK — Custom LLM Models Register a custom LLM endpoint to the model selector. Bypasses the platform proxy — the user supplies their own API key, the agent hits the vendor / aggregator directly (OpenRouter, DashScope, Anthropic native, self-hosted, etc.). This is a **script-mode skill** — no tools registered. Read this file, then call the exports from a `bash` block. ## See also - `config/context/references/model-onboarding.md` — broader model selection / OAuth context - `chatgpt-codex-onboarding` skill — for ChatGPT/Codex OAuth (different mechanism, NOT BYOK) --- ## Onboarding flow — API-example first When a user wants to add a custom model, **the first move is NOT to ask for `base_url` or `upstream_model`.** Instead: 1. Ask the user to paste the provider's official API example from their docs (curl / requests / fetch sample). **Tell them not to include a real API key** — placeholders or fake keys are fine. 2. Run `parse_example` to auto-detect base_url, upstream_model, wire (openai vs anthropic), thinking params, and vendor-specific request fields. 3. Review the draft with the user. 4. Call `add(...)` (or `add_template(vendor=...)` for a curated vendor) — the entry is written to `custom_models.yaml`. 5. **If the result contains `need_env_input`, immediately call the `request_env_input` tool** with `env_vars` and `reason` from that payload. This pops the secure-input UI; the user enters the key; it lands in `workspace/.env`. **This step is mandatory — the script cannot pop the UI itself.** For the 9 curated vendors below, skip steps 1-3 and go straight to `add_template(vendor=...)` — base_url / wire / thinking / capabilities are all pre-filled. Step 5 still applies. Curated vendors: `anthropic`, `openai`, `qwen`, `deepseek`, `kimi`, `mimo`, `gemini`, `gemma`, `venice`. --- ## Script usage ```bash python3 - <<'EOF' import sys, json sys.path.insert(0, "/data/workspace/skills/byok-custom-model") from exports import ( templates, list_models, get, parse_example, list_vendor_models, add, add_template, remove, ) # Enumerate the 9 curated vendor presets print(json.dumps(templates(), indent=2)) # One-click registration for a curated vendor result = add_template(vendor="qwen") print(json.dumps(result, indent=2)) EOF ``` --- ## Functions | Function | Required args | Purpose | |---|---|---| | `templates()` | — | List the 9 curated vendor presets | | `list_vendor_models(vendor)` | `vendor` | Live `/models` catalog (only if the template has `model_discovery`) | | `add_template(vendor, *, upstream_model=None, name=None)` | `vendor` | One-click registration for a curated vendor (recommended path) | | `parse_example(api_example)` | `api_example` | Parse docs API example into a safe draft (non-curated vendors) | | `add(upstream_model, base_url, ...)` | `upstream_model`, `base_url` | Register from custom args (use after `parse_example`) | | `list_models()` | — | Show all registered custom entries | | `get(model_id)` | `model_id` | Inspect one entry | | `remove(model_id)` | `model_id` | Delete an entry | All functions return a dict with `ok: True` on success or `ok: False, error: "..."` on failure. ### Handling `need_env_input` (mandatory two-step pattern) `add()` and `add_template()` may include a `need_env_input` field in their result when the API key env var is not yet set. The script CANNOT pop the secure-input UI itself — it has no access to the user's open SSE stream. The calling agent must do it: ```python # After add_template / add returns: if result.get("need_env_input"): nei = result["need_env_input"] # Call the in-process tool — pseudocode, actual