Obiguard Authentication
Obiguard API Key
string
required
Authenticate your requests with your Obiguard API key. Obtain API key from the Obiguard dashboard.
Environment variable:
Environment variable:
OBIGUARD_API_KEYExample
Example
- Python SDK
- cURL
Python
Provider Authentication
In addition to the Obiguard API key, you must provide information about the AI provider you’re using. There are 4 ways to do this:1. Provider Slug + Auth
Useful if you do not want to save your API keys to Obiguard vault and make direct requests.string
Specifies the provider you’re using (e.g.,
List of Obiguard supported providers here.
openai, anthropic, vertex-ai).List of Obiguard supported providers here.
string
Pass the auth details for the specified provider as a
If your provider expects their auth with headers such as
"Bearer $TOKEN".If your provider expects their auth with headers such as
x-api-key or api-key, you can pass the token with the Authorization header directly and Obiguard will convert it into the provider-specific format.Example
Example
2. Virtual Key
string
Save your provider auth on Obiguard and use a virtual key to directly make a call.
This value is pass in the same field as Obiguard API key.
Docs
Example
Example
- Python SDK
- cURL
Python
4. Custom Host
string
Specifies the base URL where you want to send your request
string
Target provider that’s availabe on your base URL. If you are unsure of which target provider to set, you can set
openai.string
Pass the auth details for the specified provider as a
If your provider expects their auth with headers such as
"Bearer $TOKEN".If your provider expects their auth with headers such as
x-api-key or api-key, you can pass the token with the Authorization header directly and Obiguard will convert it into the provider-specific format.Example
Example
- Python SDK
- cURL
Python
Custom Headers
You can pass any other headers your API expects by directly forwarding them without any processing by Obiguard.This is especially useful if you want to pass send sensitive headers.
Forward Headers
Example
Example
Python Usage
With the Python SDK, you need to transform your headers to Snake Case and then include them while initializing the Obiguard client. Example: If you have a header of the formatX-My-Custom-Header, it should be sent as X_My_Custom_Header in the SDKJavaScript Usage
With the JS SDK, you need to transform your headers to Camel Case and then include them while initializing the Obiguard client. Example: If you have a header of the formatX-My-Custom-Header, it should be sent as xMyCustomHeader in the SDKCloud-Specific Headers (Azure, Google, AWS)
Pass more configuration headers for Azure OpenAI, Google Vertex AI, or AWS Bedrock
Azure
x-obiguard-azure-resource-name,x-obiguard-azure-deployment-id,x-obiguard-azure-api-version,Authorization,x-obiguard-azure-model-name
Google Vertex AI
x-obiguard-vertex-project-id,x-obiguard-vertex-region,X-Vertex-AI-LLM-Request-Type
AWS Bedrock
x-obiguard-aws-session-token,x-obiguard-aws-secret-access-key,x-obiguard-aws-region,x-obiguard-aws-session-token
List of All Headers
The following is a comprehensive list of headers that can be used when initializing the Obiguard client. Obiguard adheres to language-specific naming conventions:- camelCase for JavaScript/Node.js parameters
- snake_case for Python parameters
- hyphenated-keys for HTTP headers
- Python
- REST Headers
Using Headers
You can send these headers in multiple ways:- Python SDK
- OpenAI SDK
- cURL
Obiguard SDK

