To set up a virtual key, follow these instructions:
Go to the Virtual Keys tab in your Obiguard sidebar.
Select Create.
Enter a unique name to your key, select the guardrail policy to apply on this key, choose your AI provider, and specify any usage details if necessary.
If your AI provider is not listed, you can select Local/Privately hosted provider and enter the API endpoint URL.
Tip: You can add multiple keys for a single provider or use distinct names for the same key to simplify management.
Your API keys are encrypted and stored in secure vaults, accessible only during a request. Decryption happens solely within isolated workers and only when required, providing maximum data security.
How are provider keys associated with virtual keys?
Virtual keys are generated randomly and mapped to the securely stored provider keys.
This ensures that your original API keys cannot be derived or reconstructed from the virtual keys.
Add the virtual key directly to the initialization configuration for the OpenAI client.
Copy
from openai import OpenAIfrom obiguard import createHeadersclient = OpenAI( base_url='https://gateway.obiguard.ai/v1', api_key='sk-***', # Your OpenAI API key here default_headers=createHeaders( provider="openai", api_key="vk-obg***", # Your Obiguard virtual key here ))