feat: add OpenRouter as image generation provider - #1
Closed
Err0r-v2 wants to merge 1 commit into
Closed
Conversation
Reuse the OpenAI SDK with a baseURL override to route through OpenRouter's API. Auto-detected when OPENROUTER_API_KEY is set (after OPENAI_API_KEY, before FAL_KEY). Can also be forced with --provider openrouter.
Err0r-v2
force-pushed
the
feat/openrouter-provider
branch
from
May 2, 2026 09:38
92566d9 to
c458867
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
openai/gpt-image-2viahttps://openrouter.ai/api/v1)OPENROUTER_API_KEYis set (priority:OPENAI_API_KEY>OPENROUTER_API_KEY>FAL_KEY)--provider openroutergenerateOpenAI()function with abaseURLoverride — no new dependenciesChanges
generate.mjs: ExtendedgenerateOpenAI()with optional{ baseURL, apiKey, model }overrides. AddedopenroutertodetectProvider()auto-detection. Updated main dispatch and metadata recording.SKILL.md: Updated shared setup step 3 to mentionOPENROUTER_API_KEY.Why
OpenRouter provides a unified API gateway that many developers already use. This lets users generate screenshots without a direct OpenAI API key — useful for teams that route all LLM/image traffic through OpenRouter for billing, rate limiting, or key management.
Test plan
OPENROUTER_API_KEY, verify auto-detection picksopenrouter--provider openrouterexplicitlyOPENAI_API_KEYstill takes priority when both are set