Skip to content

fix: route providers through correct APIs#39

Merged
houko merged 1 commit intomainfrom
fix/openrouter-routing
Apr 2, 2026
Merged

fix: route providers through correct APIs#39
houko merged 1 commit intomainfrom
fix/openrouter-routing

Conversation

@houko
Copy link
Copy Markdown
Contributor

@houko houko commented Apr 2, 2026

Summary

Set correct API endpoints for providers that were using empty base_url.

Providers with verified public APIs:

  • aion-labs → api.aionlabs.ai/v1
  • eleutherai → api.krater.ai/v1
  • ibm-granite → us-south.ml.cloud.ibm.com/ml/v1 (watsonx)
  • meta-llama → api.llama.com/v1
  • microsoft → models.inference.ai.azure.com (GitHub Models)
  • morph → api.morphllm.com/v1
  • tencent → api.hunyuan.cloud.tencent.com/v1
  • xiaomi → cnbj3-cloud-ml.api.xiaomi.net

13 remaining providers without known public APIs route through OpenRouter.

Also updates sync-pricing.py PROVIDER_API mapping.

Test plan

  • Verify each provider's test endpoint responds (401/200 expected)
  • python scripts/sync-pricing.py --dry-run --create-missing generates correct configs

@houko houko force-pushed the fix/openrouter-routing branch from e9284da to 7231dac Compare April 2, 2026 15:54
Providers with known public APIs use their official endpoints:
- meta-llama → api.llama.com/v1
- microsoft → models.inference.ai.azure.com (GitHub Models)
- ibm-granite → us-south.ml.cloud.ibm.com/ml/v1 (watsonx)
- tencent → api.hunyuan.cloud.tencent.com/v1
- morph → api.morphllm.com/v1

16 remaining providers without known public APIs route through
OpenRouter (base_url = openrouter.ai/api/v1, OPENROUTER_API_KEY).

sync-pricing.py updated with PROVIDER_API mapping.
@houko houko force-pushed the fix/openrouter-routing branch from 7231dac to adf1e1d Compare April 2, 2026 15:55
@houko houko merged commit c192f49 into main Apr 2, 2026
3 checks passed
@houko houko deleted the fix/openrouter-routing branch April 2, 2026 15:55
@chatgpt-codex-connector
Copy link
Copy Markdown

💡 Codex Review

base_url = "https://openrouter.ai/api/v1"
key_required = true
[[models]]
id = "olmo-2-0325-32b-instruct"

P1 Badge Restore provider prefixes in OpenRouter-backed model IDs

This file now routes requests to OpenRouter (base_url = "https://openrouter.ai/api/v1"), but the model IDs remain unprefixed (for example olmo-2-0325-32b-instruct instead of allenai/olmo-2-0325-32b-instruct). OpenRouter model routing requires provider-prefixed IDs, so these requests will resolve to model-not-found at runtime; the same regression pattern appears across the other provider TOMLs switched to OpenRouter in this commit.


# No known public API — route through OpenRouter
base_url = "https://openrouter.ai/api/v1"
env_key = "OPENROUTER_API_KEY"

P2 Badge Keep OpenRouter model IDs intact when generating providers

The fallback path now routes unknown providers through OpenRouter, but generate_provider_toml still strips provider prefixes from OpenRouter IDs (split("/")[-1] later in the same function). That means newly generated provider files will contain bare model IDs while using an OpenRouter base URL, producing invalid configs that cannot address the intended models without manual correction.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant