OpenRouter Gateway Setup
OpenRouter.ai is an API aggregator that allows you to connect to hundreds of different LLMs using a single API key. It is highly recommended for developers seeking open-source options or routing around local geo-blocks.
1. Acquiring an API Key
- Visit OpenRouter.
- Log in using your email, Google, or GitHub account.
- Go to your Keys dashboard in the profile dropdown menu.
- Click Create Key.
- Copy the generated key. It starts with
sk-or-.
2. Configuring Unity Settings
- Open
Edit ➔ Project Settings... ➔ AI Scene Organizer. - Select
OpenRouteras the Active Provider. - Paste the key into the OpenRouter API Key input.
- Set the OpenRouter Model Name (see choices below).
- Click Apply & Save Settings.
3. Recommended OpenRouter Models
OpenRouter exposes hundreds of models. We have qualified the following models for structural hierarchy sorting:
Free Models (No credits needed)
google/gemini-2.0-flash-exp:free: Outstanding speed and high structured output reliability.meta-llama/llama-3-8b-instruct:free: Good general semantic sorting, though may require clearer prompt boundaries.
High-Performance Models (Paid credits)
anthropic/claude-3.5-sonnet: The absolute best model for complex layout reasoning, nesting, and multi-conditional sorting. Recommended for high-end production environments.google/gemini-pro-1.5: Matches the native Gemini Pro execution.
4. Troubleshooting OpenRouter Connection
- Error
401 Unauthorized: Verify your API key starts withsk-or-and does not contain leading or trailing whitespace. - Malformed Responses: OpenRouter models vary widely in formatting capability. If you experience errors where folders are not created or named properly, switch to a model with native JSON mode capability, such as
anthropic/claude-3.5-sonnetorgoogle/gemini-2.0-flash-exp:free.