stage-endpoint

Stage model endpoints in local Postgres and test them via curl against the local cfw-api.

7|12|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/OpenRouterTeam/docs --skill stage-endpoint-openrouterteam
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: stage-endpoint
Source: https://github.com/OpenRouterTeam/docs/tree/main/.agents/skills/stage-endpoint
Command: npx skills add https://github.com/OpenRouterTeam/docs --skill stage-endpoint-openrouterteam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Getting a new model and endpoint into the local OpenRouter development environment requires correctly populating Postgres rows (models, endpoints, pricing_versions), refreshing the KV cache, and verifying routing — a process with many failure modes like hidden rows, stale caches, and missing pricing. This Skill provides the exact two-path workflow (prod-first seeding or manual SQL staging) plus debugging guidance to get an endpoint serving requests locally. ## Core Features & Use Cases - Prod-first seeding path: Refresh seed CSVs from the prod DB via the GitHub Action, run the seed script, and unhide rows locally for zero-drift staging. - Manual SQL staging fallback: Insert models, endpoints, and pricing_versions by hand with full field references for modalities, features JSON, provider overrides, and parameter arrays. - Cache refresh and curl testing: Ordered catalog refresh (restart api, run api-kv-cron, restart consumers) plus ready-made curl commands for chat, streaming, reasoning, tools, embeddings, and video. - Use Case: You are developing a new provider adapter and need to test requests end-to-end locally — stage the model and endpoint, refresh the KV cache, and debug routing via dev-fs-logs until curl returns a valid response. ## Quick Start Ask the agent to stage the model openai/gpt-4o with provider OpenAI in the local database and verify it with a test chat completion request.

Frequently Asked Questions about stage-endpoint

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

FAQPage Schema
How do I stage a model endpoint in the local OpenRouter database?▼

Prefer the prod-first path: create the model in prod, refresh the seed CSVs via the Refresh Models and Endpoints GitHub Action, then run the seed script to upsert rows locally. Manual SQL inserts are the fallback for providers not yet in prod.

How do I test a staged endpoint with curl locally?▼

Send a POST to http://localhost:8787/api/v1/chat/completions with the model slug and an Authorization bearer token. Embeddings use port 8789 via cfw-embeddings-api, and video routes use port 8788 via cfw-video-api.

Why does my staged endpoint return 404 No endpoints found?▼

The endpoint is missing from the KV cache or was force-disabled. Refresh the cache by restarting api and running api-kv-cron, and confirm a pricing_versions row exists with a backdated effective_at so the bucketed-now pricing join resolves.

When should I use manual SQL staging instead of seed CSVs?▼

Use manual SQL only when the model or provider cannot exist in prod yet, such as during brand-new adapter development. Hand-staged endpoints are not overwritten by seed upserts, so delete them before re-seeding to avoid duplicates.

Why does my endpoint disappear after the KV warm cron runs?▼

The pricing_versions row is missing or its effective_at is not yet visible under the bucketed now comparison, so the endpoint is force-disabled as invalid pricing. Insert pricing with effective_at set to now minus one day, then re-run the cron.