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

  1. Visit OpenRouter.
  2. Log in using your email, Google, or GitHub account.
  3. Go to your Keys dashboard in the profile dropdown menu.
  4. Click Create Key.
  5. Copy the generated key. It starts with sk-or-.

2. Configuring Unity Settings

  1. Open Edit ➔ Project Settings... ➔ AI Scene Organizer.
  2. Select OpenRouter as the Active Provider.
  3. Paste the key into the OpenRouter API Key input.
  4. Set the OpenRouter Model Name (see choices below).
  5. Click Apply & Save Settings.

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 with sk-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-sonnet or google/gemini-2.0-flash-exp:free.

This site uses Just the Docs, a documentation theme for Jekyll.