Menu ▾ ▴

#9 Add `openrouter` provider to `orko-providers` crate

closed
nobody
2026-11-21
2026-08-11
Anonymous
No

Originally created by: SAMAD101

Summary

Add an openrouter preset to orko-providers. OpenAI-compatible — a thin preset over the engine from [#3], same shape as [#5].

Spec

  • Base URL: https://openrouter.ai/api/v1 (configurable)
  • Env key: OPENROUTER_API_KEY, sent as Authorization: Bearer …
  • Fallible from_str("openrouter:anthropic/claude-sonnet-4.5") — model ids contain / (and sometimes : suffixes like :free); the parser must split on the first : only

Quirks

  • OpenRouter recommends optional attribution headers (HTTP-Referer, X-Title). The quirks struct should support extra static headers so the preset (or the user) can set them; don't hardcode values.

Acceptance

  • Preset constructor openrouter(model); env key + base URL resolved conventionally
  • from_str round-trip tests incl. openrouter:vendor/model:free
  • clippy -D warnings clean; builds with --no-default-features

Depends on [#3].

Related

Tickets: #26
Tickets: #3
Tickets: #5

Discussion

  • Anonymous

    Anonymous - 2026-08-23

    Originally posted by: Triumph1701

    The OpenRouter preset should keep the provider-specific quirks at the preset boundary: configurable base URL and static headers, conventional key resolution, and a parser that splits the qualified model on the first colon only. I’d add round-trip tests for slashed model IDs and :free suffixes, then keep the generic OpenAI-compatible engine independent of the preset.

     
  • Anonymous

    Anonymous - 2026-08-23

    Originally posted by: SAMAD101

    @Triumph1701 hmm thats the plan, currently all the issues are blocked by [#3] , so once that done others will follow

     

    Related

    Tickets: #3

  • Anonymous

    Anonymous - 2026-11-21

    Ticket changed by: SAMAD101

    • status: open --> closed
     

Log in to post a comment.