Headers
Header requirements and options for the Obiguard API
Obiguard API accepts 4 kinds of headers for your requests:
Obiguard Authentication Header | Required | For Obiguard auth |
Provider Authentication Headers OR Cloud-Specific Headers | Required | For provider auth |
Custom Headers | Optional | To forward any other headers directly |
Obiguard Authentication
Obiguard API Key
Authenticate your requests with your Obiguard API key. Obtain API key from the Obiguard dashboard.
Environment variable: OBIGUARD_API_KEY
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.
Specifies the provider you’re using (e.g., openai
, anthropic
, vertex-ai
).
List of Obiguard supported providers here.
Pass the auth details for the specified provider as a "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.
2. Virtual Key
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
4. Custom Host
Specifies the base URL where you want to send your request
Target provider that’s availabe on your base URL. If you are unsure of which target provider to set, you can set openai
.
Pass the auth details for the specified provider as a "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.
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
Pass all the headers you want to forward directly in this array. (Docs)
Cloud-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
Parameter | Type | Key |
---|---|---|
API Key Your Obiguard account’s API Key. | stringrequired | obiguard_api_key |
Provider The AI provider to use for your calls. (supported providers). | string | provider |
Base URL You can edit the URL of the gateway to use. | string | base_url |
Custom Host Route to locally or privately hosted model by configuring the API URL with custom host | string | custom_host |
Forward Headers Forward sensitive headers directly to your model’s API without any processing from Obiguard. | array of string | forward_headers |
Azure OpenAI Headers Configuration headers for Azure OpenAI that you can send separately | string | azure_resource_name azure_deployment_id azure_api_version azure_model_name |
Google Vertex AI Headers Configuration headers for Vertex AI that you can send separately | string | vertex_project_id vertex_region |
AWS Bedrock Headers Configuration headers for Bedrock that you can send separately | string | aws_access_key_id aws_secret_access_key aws_region aws_session_token |
Parameter | Type | Key |
---|---|---|
API Key Your Obiguard account’s API Key. | stringrequired | obiguard_api_key |
Provider The AI provider to use for your calls. (supported providers). | string | provider |
Base URL You can edit the URL of the gateway to use. | string | base_url |
Custom Host Route to locally or privately hosted model by configuring the API URL with custom host | string | custom_host |
Forward Headers Forward sensitive headers directly to your model’s API without any processing from Obiguard. | array of string | forward_headers |
Azure OpenAI Headers Configuration headers for Azure OpenAI that you can send separately | string | azure_resource_name azure_deployment_id azure_api_version azure_model_name |
Google Vertex AI Headers Configuration headers for Vertex AI that you can send separately | string | vertex_project_id vertex_region |
AWS Bedrock Headers Configuration headers for Bedrock that you can send separately | string | aws_access_key_id aws_secret_access_key aws_region aws_session_token |
Parameter | Type | Header Key |
---|---|---|
API Key Your Obiguard account’s API Key. | stringrequired | x-obiguard-api-key |
Provider The AI provider to use for your calls. (supported providers). | string | x-obiguard-provider |
Base URL You can edit the URL of the gateway to use. | string | Change the request URL |
Forward Headers Forward sensitive headers directly to your model’s API without any processing from Obiguard. | array of string | x-obiguard-forward-headers |
Azure OpenAI Headers Configuration headers for Azure OpenAI that you can send separately | string | x-obiguard-azure-resource-name , x-obiguard-azure-deployment-id , x-obiguard-azure-api-version , x-obiguard-azure-model-name |
Google Vertex AI Headers Configuration headers for Vertex AI that you can send separately | string | x-obiguard-vertex-project-id , x-obiguard-vertex-region |
AWS Bedrock Headers Configuration headers for Bedrock that you can send separately | string | x-obiguard-aws-session-token , x-obiguard-aws-secret-access-key , x-obiguard-aws-region , x-obiguard-aws-session-token |
Using Headers
You can send these headers in multiple ways: