Welcome to Portkey Forum

Updated 3 days ago

Accessing virtual keys for conditional routing in portkey

Heyy everyone, I am new to Portkey and am a bit overwhelmed by this amazing project. I am currently local hosting the docker compose container and am working on conditional routing. The documentation told me to create virtual keys for the targets, however, I could not find out where can I create those virtual keys locally except creating the keys on the official app.portkey.ai console. Does that mean that to use conditional routing, I must access the service through portkey cloud?

Also, I could not access the gateway console on http://localhost:8787/public/ as this route simply does not exist in the index.ts. Therefore, I am super confused by the GitHub README documentation.
v
R
7 comments
Hi, virtual keys are not supported in the Open Source version currently. But you can substitute it with provider and api_key fields in the config. You can checkout one example here: https://portkey.ai/docs/product/ai-gateway/universal-api#powerful-routing-and-fallback-strategies

Please let me know if you need help with any specific providers.
Also, I could not access the gateway console on http://localhost:8787/public/ as this route simply does not exist in the index.ts. Therefore, I am super confused by the GitHub README documentation.
Thread

Can you please mention the version of docker image that you are using? It seems to be working fine on the latest version (1.10.2)

There were some issues related to the trailing slash in the url in an older version. But that was resolved. Just to verify, can you please check without the trailing slash

  • http://localhost:8787/public
Here is the part of my docker-compose code:
gateway: container_name: "gentlemen_gateway" image: portkeyai/gateway:latest restart: always ports: - "8787:8787" networks: - "gentlemen_network" env_file: - .env depends_on: - db
The url with or without trailing both returns {"message":"Not Found","ok":false}
Oh I found out what went wrong. the latest image I pulled was from half years ago. So the version was 1.8.0. I just pulled the latest version again and it solved the problem
Add a reply
Sign up and join the conversation on Discord