agents-sync-openrouter-models
sync-openrouter-modelsRefreshes the OpenRouter model catalog the crate embeds (adapters::openrouter::models) from OpenRouter's model list: data/openrouter-models.txt, every model id sorted, and data/openrouter-constants.txt, a named constant per model of the curated providers.
cargo run -p utopia-agents --bin agents-sync-openrouter-models
cargo run -p utopia-agents --bin agents-sync-openrouter-models -- /tmp/catalogModels without a string id are dropped and the rest sorted by id. The
curated providers (anthropic, openai, google, meta-llama,
deepseek, mistralai, x-ai) get a constant named after the id
(openai/gpt-4o is MODEL_OPENAI_GPT_4O), except date-pinned
snapshots and :extended, :free, :beta, preview, GPT-3.5 and
GPT-4 Turbo variants; a name taken twice gets the first eight hex
digits of the id's SHA-1 appended. Rebuild the crate after a sync: the
catalog is embedded at compile time.
Arguments
[output-path]the directory the two data files are written to, created when missing (default: the crate's data/).
Environment
OPENROUTER_MODELS_ENDPOINTwhere the catalog is fetched from (default https://openrouter.ai/api/v1/models).
OPENROUTER_API_KEY, else LLM_KEY_OPENROUTER: sent as a bearer token when set.
Exit codes
0written (Wrote <n> named constants + <m> model IDs to <path>).
1the catalog could not be fetched, has no data array, or has no model; the reason is on standard error.
Writes
crates/utopia/agents/data/openrouter-constants.txtcrates/utopia/agents/data/openrouter-models.txt
The crate embeds these files when it is compiled: rebuild after running the task.