Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Adding OpenRouter to Nango: why /v1/models accepts a fake key

Описание и применение

Нужно было добавить OpenRouter в Nango и выбрать правильный эндпоинт проверки ключа. /v1/models всегда возвращал 200, поэтому использовался /v1/key, который возвращает 200 только для действительных ключей.

Задача

Nango needed a verification endpoint for OpenRouter to ensure API keys are valid before saving connections, but the common /v1/models endpoint returned 200 for fake or missing keys.

Результат

By selecting /v1/key as the verification endpoint, Nango now correctly validates OpenRouter API keys, preventing invalid connections and reducing debugging time.

Рабочий процесс

  • 1. Open Nango provider YAML and add OpenRouter configuration with API key auth and base URL.
  • 2. Identify potential verification endpoint; test /v1/models with fake, real, and no key – all return 200.
  • 3. Test /v1/key endpoint: fake key returns 401, no key returns 401, real key returns 200.
  • 4. Set /v1/key as the verification endpoint in the YAML.
  • 5. Run provider validation scripts and prettier checks to confirm YAML correctness.
  • 6. Submit PR to Nango repository.
  • 7. (Optional) Run full end-to-end Docker compose test and link checks.

Доказательства

A fake key. 200. I tried again with a key that matches the real sk-or-v1- shape: 200. With no Authorization header at all: 200

Источник

With my real key the same call returns 200. Fake key 401, no key 401, real key 200.

Источник

  • Дата записи: 2026-09-20T10:30:37.977Z