Skip to content

feat(text): add OpenRouter provider via OpenResponses#284

Merged
Kamilbenkirane merged 2 commits into
mainfrom
feat/openrouter-text
Jun 12, 2026
Merged

feat(text): add OpenRouter provider via OpenResponses#284
Kamilbenkirane merged 2 commits into
mainfrom
feat/openrouter-text

Conversation

@Kamilbenkirane

Copy link
Copy Markdown
Member

Summary

  • Add Provider.OPENROUTER with OPENROUTER_API_KEY auth and default base URL https://openrouter.ai/api
  • Wire a minimal OpenRouterTextClient (Ollama-style OpenResponsesTextClient subclass) with optional attribution headers from OPENROUTER_HTTP_REFERER / OPENROUTER_APP_TITLE
  • Use an empty model catalog so any OpenRouter slug works via explicit model= (same pattern as Ollama)

Usage

await celeste.text.generate(
    "Hello",
    model="openai/gpt-4o",
    provider=Provider.OPENROUTER,
)

Test plan

  • make lint / make typecheck
  • Pre-commit and pre-push hooks (668 unit tests)
  • OpenRouter covered via shared OpenResponses machinery + enum/fallback patterns (no dedicated test file, matching Ollama)

Made with Cursor

Kamilbenkirane and others added 2 commits June 12, 2026 17:29
Register Provider.OPENROUTER with env-based auth and a minimal
OpenResponsesTextClient subclass so users can call any OpenRouter
model slug without a curated catalog.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use extra_headers at call time instead of reading OPENROUTER_HTTP_REFERER
and OPENROUTER_APP_TITLE via os.environ, matching other providers.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Kamilbenkirane Kamilbenkirane merged commit cf3bb94 into main Jun 12, 2026
11 checks passed
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