mirror of
https://github.com/vegu-ai/talemate.git
synced 2025-12-17 04:07:47 +01:00
120 lines
7.5 KiB
Markdown
120 lines
7.5 KiB
Markdown
|
|
# OpenRouter
|
||
|
|
|
||
|
|
The OpenRouter backend provides access to image generation, editing, and analysis capabilities through OpenRouter's unified API. OpenRouter allows you to access multiple AI providers through a single API, giving you flexibility to choose from various models and providers.
|
||
|
|
|
||
|
|

|
||
|
|
|
||
|
|
## Prerequisites
|
||
|
|
|
||
|
|
Before configuring the OpenRouter backend, you need to obtain an OpenRouter API key:
|
||
|
|
|
||
|
|
1. Go to [OpenRouter Keys](https://openrouter.ai/settings/keys)
|
||
|
|
2. Sign in with your account
|
||
|
|
3. Create a new API key or use an existing one
|
||
|
|
4. Copy the API key
|
||
|
|
|
||
|
|
Then configure it in Talemate:
|
||
|
|
|
||
|
|
1. Open Talemate Settings → Application → OpenRouter API
|
||
|
|
2. Paste your OpenRouter API key in the "OpenRouter API Key" field
|
||
|
|
3. Save your changes
|
||
|
|
|
||
|
|
For additional instructions, see the [OpenRouter API setup guide](/talemate/user-guide/apis/openrouter/).
|
||
|
|
|
||
|
|
## Configuration
|
||
|
|
|
||
|
|
In the Visualizer agent settings, select OpenRouter as your backend for text-to-image generation, image editing, image analysis, or any combination of these. Each operation can be configured separately.
|
||
|
|
|
||
|
|
### Text-to-Image Configuration
|
||
|
|
|
||
|
|
For text-to-image generation, configure the following settings:
|
||
|
|
|
||
|
|
- **OpenRouter API Key**: Your OpenRouter API key (configured globally in Talemate Settings)
|
||
|
|
- **Model**: Select an image generation model from OpenRouter. The model list is dynamically populated based on models available through your OpenRouter account.
|
||
|
|
- **Only use these providers**: Optionally filter to specific providers (e.g., only use Google or OpenAI)
|
||
|
|
- **Ignore these providers**: Optionally exclude specific providers from consideration
|
||
|
|
|
||
|
|

|
||
|
|
|
||
|
|
!!! warning "Model Selection"
|
||
|
|
There is no reliable way for Talemate to determine which models support text-to-image generation, so the model list is unfiltered. Please consult the [OpenRouter documentation](https://openrouter.ai/docs) to verify that your selected model supports image generation before using it.
|
||
|
|
|
||
|
|
The OpenRouter backend automatically handles aspect ratios based on the format you select:
|
||
|
|
|
||
|
|
- **Landscape**: 16:9 aspect ratio
|
||
|
|
- **Portrait**: 9:16 aspect ratio
|
||
|
|
- **Square**: 1:1 aspect ratio
|
||
|
|
|
||
|
|
### Image Editing Configuration
|
||
|
|
|
||
|
|
For image editing, configure similar settings with an additional option:
|
||
|
|
|
||
|
|
- **OpenRouter API Key**: Your OpenRouter API key
|
||
|
|
- **Model**: Select an image editing model from OpenRouter
|
||
|
|
- **Max References**: Configure the maximum number of reference images (1-3). This determines how many reference images you can provide when editing an image.
|
||
|
|
- **Provider filtering**: Optionally filter providers (same as text-to-image)
|
||
|
|
|
||
|
|

|
||
|
|
|
||
|
|
!!! warning "Model Selection"
|
||
|
|
There is no reliable way for Talemate to determine which models support image editing, so the model list is unfiltered. Image editing refers to image generation with support for 1 or more contextual reference images. Please consult the [OpenRouter documentation](https://openrouter.ai/docs) to verify that your selected model supports image editing before using it.
|
||
|
|
|
||
|
|
### Image Analysis Configuration
|
||
|
|
|
||
|
|
For image analysis, configure the following:
|
||
|
|
|
||
|
|
- **OpenRouter API Key**: Your OpenRouter API key
|
||
|
|
- **Model**: Select a vision-capable text model from OpenRouter
|
||
|
|
- **Provider filtering**: Optionally filter providers
|
||
|
|
|
||
|
|

|
||
|
|
|
||
|
|
!!! warning "Model Selection"
|
||
|
|
There is no reliable way for Talemate to determine which models support image analysis, so the model list is unfiltered. Image analysis requires a text generation model that is multi-modal and supports vision capabilities. Please consult the [OpenRouter documentation](https://openrouter.ai/docs) to verify that your selected model supports vision before using it.
|
||
|
|
|
||
|
|
## Usage
|
||
|
|
|
||
|
|
Once configured, the OpenRouter backend will appear in the Visualizer agent status with green indicators showing which capabilities are available.
|
||
|
|
|
||
|
|

|
||
|
|
|
||
|
|
The status indicators show:
|
||
|
|
|
||
|
|
- **Text to Image**: Available when text-to-image backend is configured
|
||
|
|
- **Image Edit**: Available when image editing backend is configured (shows max references if configured)
|
||
|
|
- **Image Analysis**: Available when image analysis backend is configured
|
||
|
|
|
||
|
|
## Model Recommendations
|
||
|
|
|
||
|
|
OpenRouter provides access to many models from different providers. Here are some general recommendations:
|
||
|
|
|
||
|
|
### Text-to-Image and Image Editing
|
||
|
|
|
||
|
|
- **google/gemini-2.5-flash-image**: Fast image generation with good quality
|
||
|
|
- **google/gemini-3-pro-image-preview**: Higher quality option (if available)
|
||
|
|
|
||
|
|
### Image Analysis
|
||
|
|
|
||
|
|
- **google/gemini-2.5-flash**: Fast analysis with good accuracy
|
||
|
|
- **google/gemini-2.5-pro**: Higher quality analysis
|
||
|
|
- **google/gemini-3-pro-preview**: Latest capabilities (if available)
|
||
|
|
|
||
|
|
## Provider Filtering
|
||
|
|
|
||
|
|
OpenRouter allows you to filter which providers are used for a specific model. This can be useful if:
|
||
|
|
|
||
|
|
- You want to use a specific provider for cost or quality reasons
|
||
|
|
- You want to avoid certain providers
|
||
|
|
- You want to test different providers for the same model
|
||
|
|
|
||
|
|
You can configure provider filtering in each backend's settings:
|
||
|
|
|
||
|
|
- **Only use these providers**: Limits requests to only the selected providers
|
||
|
|
- **Ignore these providers**: Excludes the selected providers from consideration
|
||
|
|
|
||
|
|
If both are configured, "Only use these providers" takes precedence.
|
||
|
|
|
||
|
|
## Prompt Formatting
|
||
|
|
|
||
|
|
The OpenRouter backend uses **Descriptive** prompt formatting by default. This means prompts are formatted as natural language descriptions rather than keyword lists. Provide detailed, natural language descriptions of what you want to create or edit.
|