Skip to main content
  1. Posts/

Safe money while accessing all popular AI-Models with Open Router and Open WebUI (Setup Guide)!

·622 words·3 mins· loading · loading ·
Table of Contents

Introduction
#

The problem
#

I use multiple AI models daily: ChatGPT for everyday questions and research, Claude for helping me understanding code. But I also wanted to try Gemini and DeepSeek (not just in the free plan). Paying a premium subscription for every single one of these would be expensive - for example, monthly costs (as of December 2025):

  • Claude Pro: 21,42 €
  • ChatGPT Plus: 23€
  • Google AI Plus: 7,99€

In summary I would have to pay at least around 52€ per month - of course I could just stick to the free plans, but I get to the limits pretty fast.

My solution
#

Then I heard about OpenRouter (big shoutout to my teamlead for telling me about this). OpenRouter gives me the possibility to access hundreds of models at the same time, by just having to pay what I actually use. The payment is based on the usage of tokens (explanation here), which is (for me) quiet cheaper every month (about 10€ to 20€). Also, if I have months, were I nearly dont use the AI, I dont have to pay anything. OpenRouter combined with OpenWebUI is awesome! Feel free to follow this guide, if you want to set it up by yourself.

Requirements
#

  • Account at OpenRouter
  • Server to host OpenWebUI
  • Docker installed on the server
    It is 100% possible to use OpenRouter without OpenWebUI, but I prefer it.

Setup
#

OpenRouter
#

  1. Create an account at OpenRouter and login.
  2. Access your account settings:
  3. Account Settings
  4. Open the section “API Keys”:
  5. API Keys
  6. Create a new API Key (change the settings to suit your needs) and save it!
  7. Now, switch to “credits”:
  8. Account Credits
  9. Buy some credits. You can start low, for like 5€ - more than enough for testing. Disclaimer: OpenRouter has a fee for the usage of their services - 5.5% of the amount of the credits you buy.

OpenWeb UI
#

  1. Access your server and install Docker, if you dont have it already installed. There are plenty of instructions online for every type of OS, so I wont explain it here.
  2. Create a new “docker-compose.yml” and insert the Docker Compose of OpenWebUI. Example docker-compose.yml (from the offical docs):
  3.  services:
     openwebui:
         image: ghcr.io/open-webui/open-webui:main
         ports:
         - "3000:8080"
         volumes:
         - open-webui:/app/backend/data
     volumes:
     open-webui:
    
  4. Start the service with docker compose up -d
  5. After installing, visit http://localhost:3000 to access Open WebUI on the server. If you want to access it from a client, type in the IP-Adress of the server and the port 3000, for example: http://192.168.178.13:3000.
  6. Create an account and login
  7. Go to the Admin-Panel:
  8. Admin Panel
  9. Open the Settings section:
  10. Settings
  11. Switch to “Connections” and add a new “OpenAI-API” connection:
  12. Connections
  13. Choose https://api.openai.com/v1 as the URL and enter your API-Key from OpenRouter:
  14. openai
  15. After the connection is added, switch to the section “Functions” and create a new function. Add this function (the OpenRouterAPI.py from the Github Repository)
  16. Now you should be able to choose from a model on the top of the chats!:
  17. Chat

Nice to know
#

You can see your Token usage in OpenRouter, to get a feeling of how much your requests cost. If you want to save Tokens, enter a System-Prompt that tells the AI to answer brief and concise and dont use emojis or clichés. We dont need the AI to spend tokens on telling me, that my question is great with 10 different emojis.. I am not a “Prompt-Pro”, try to build your own System-Prompt by your desires. You can enter it in the Chat settings of OpenWeb UI:

Also, ask your questions short and specifically, if you want to use even less tokens. You dont have to say “Thank You”, which also would use tokens - this article from the New York Times helps understanding why: Saying ‘Thank You’ to ChatGPT Is Costly.

torminal
Author
torminal
IT enthusiast

Related

Hetzner/IONOS: free SSL certificates with certbot
958 words·5 mins· loading · loading
Linux Mint: Fix Boot issue, stuck on splash screen
500 words·3 mins· loading · loading
Hetzner/IONOS: Automate renewal of free SSL Certificates with NGINX Proxy Manager
662 words·4 mins· loading · loading