add-key-provider

Adds key-auth model providers to the harness via config or provider.rs code changes.

10|1|Updated Jul 7, 2026
One-click install
npx skills add https://github.com/catalystctl/catcode --skill add-key-provider-catalystctl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-key-provider
Source: https://github.com/catalystctl/catcode/tree/main/.catalyst-code/skills/add-key-provider
Command: npx skills add https://github.com/catalystctl/catcode --skill add-key-provider-catalystctl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Connecting a new OpenAI- or Anthropic-compatible model provider to the Catalyst Code harness requires knowing whether the provider's model-discovery endpoint matches a known response shape; this Skill makes that determination and performs either the config-only setup or the required code change in provider.rs. ## Core Features & Use Cases - Decision tree for config vs code: Classifies a provider's model-discovery JSON into four shapes (Umans /models/info, OpenAI /models, Anthropic /v1/models, or custom) to decide if a config-only setup is possible. - Config-only provider setup: Writes a providers entry into ~/.config/catalyst-code/config.json with kind, base_url, api_key_env, headers, and per-model models_override capability entries. - Code-change path for custom discovery: Implements the OpenCode-Go pattern in core/src/provider.rs with a host matcher, capabilities table, known-models table, wire-protocol router, and unit tests. - Use Case: A user says "add provider X" — the Skill reads the provider's API docs, samples its model-listing response, and either writes the config entry or adds a discovery branch with tests. ## Quick Start Ask the agent to add a new model provider by giving it the provider's base URL, API key environment variable, and a sample of its model-listing JSON response.

Frequently Asked Questions about add-key-provider

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new model provider to Catalyst Code?

Add a providers entry to ~/.config/catalyst-code/config.json with name, kind (openai or anthropic), base_url including the version segment, and api_key_env. This works config-only when the provider's model-discovery response matches one of the three known shapes.

When does adding a provider require a code change instead of config?

A code change in core/src/provider.rs is required when the model-discovery endpoint returns a custom response shape or 404s on all three known paths. You then add a host matcher, capabilities table, and a discovery parser following the OpenCode-Go pattern.

Can I override per-model context window and token limits via config?

Yes, the models_override config field accepts per-model entries with id, context_window, max_tokens, reasoning, and thinking_levels. Explicit per-model values win over discovery results, models.dev data, and per-provider defaults.

Why does my custom provider return 400 errors after setup?

A common cause is a host matcher using bare contains() that misidentifies look-alike domains and enables provider-specific wire fields on the wrong endpoint. Matchers must parse the host exactly, as is_umans and is_opencode_go do.

How do I refresh stale model discovery cache after changing the parser?

Bump MODELS_CACHE_VERSION so stale caches refresh, since the cache is keyed by base_url and kind with an 8-hour TTL. You can also delete ~/.config/catalyst-code/models-cache.json to force a refresh during testing.