Skip to content

feat: add OpenRouter as image generation provider - #1

Closed
Err0r-v2 wants to merge 1 commit into
hypersocialinc:masterfrom
Err0r-v2:feat/openrouter-provider
Closed

feat: add OpenRouter as image generation provider#1
Err0r-v2 wants to merge 1 commit into
hypersocialinc:masterfrom
Err0r-v2:feat/openrouter-provider

Conversation

@Err0r-v2

@Err0r-v2 Err0r-v2 commented May 2, 2026

Copy link
Copy Markdown

Summary

  • Adds OpenRouter as a third provider option for image generation (openai/gpt-image-2 via https://openrouter.ai/api/v1)
  • Auto-detected when OPENROUTER_API_KEY is set (priority: OPENAI_API_KEY > OPENROUTER_API_KEY > FAL_KEY)
  • Can be forced with --provider openrouter
  • Reuses the existing generateOpenAI() function with a baseURL override — no new dependencies

Changes

  • generate.mjs: Extended generateOpenAI() with optional { baseURL, apiKey, model } overrides. Added openrouter to detectProvider() auto-detection. Updated main dispatch and metadata recording.
  • SKILL.md: Updated shared setup step 3 to mention OPENROUTER_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

  • Set only OPENROUTER_API_KEY, verify auto-detection picks openrouter
  • Run with --provider openrouter explicitly
  • Verify generated composite and metadata.json record the correct provider
  • Confirm OPENAI_API_KEY still takes priority when both are set

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
Err0r-v2 force-pushed the feat/openrouter-provider branch from 92566d9 to c458867 Compare May 2, 2026 09:38
@Err0r-v2 Err0r-v2 closed this by deleting the head repository May 26, 2026
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