Skip to main content
Obiguard API accepts 4 kinds of headers for your requests:

Obiguard Authentication

Obiguard API Key

string
required
Authenticate your requests with your Obiguard API key. Obtain API key from the Obiguard dashboard.
Environment variable: OBIGUARD_API_KEY
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., openai, anthropic, vertex-ai).
List of Obiguard supported providers here.
string
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

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
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 "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.
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

array of strings
Pass all the headers you want to forward directly in this array. (Docs)

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 format X-My-Custom-Header, it should be sent as X_My_Custom_Header in the SDK

JavaScript 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 format X-My-Custom-Header, it should be sent as xMyCustomHeader in the SDK

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

Using Headers

You can send these headers in multiple ways:
Obiguard SDK