Passthrough
Overview
Section titled “Overview”Passthrough integrations let you call provider-native API paths and payloads through DeepintShield. You keep the exact request and response shapes your provider SDK expects, and the provider’s response (status, headers, and body) comes back unchanged for both streaming and non-streaming requests, while still gaining DeepintShield features such as governance, logging, and observability.
Use passthrough when you need a provider endpoint that is not yet covered by a dedicated DeepintShield integration route.
Endpoints
Section titled “Endpoints”Point your provider SDK or HTTP client at the matching passthrough endpoint:
| Endpoint | Provider |
|---|---|
/openai_passthrough | OpenAI |
/anthropic_passthrough | Anthropic |
/genai_passthrough | Gemini, or Vertex AI (auto-detected) |
For GenAI, send Gemini-style requests to /genai_passthrough as usual. To route a request through Vertex AI instead, configure your client for Vertex (vertexai=True) - DeepintShield routes to Vertex automatically when the request uses a Vertex-style path (/projects/{PROJECT_ID}/locations/{LOCATION}/), a Vertex model resource path, or a Vertex OAuth token (Bearer ya29...). See the Vertex-style example below.
Usage Examples
Section titled “Usage Examples”OpenAI Passthrough
Section titled “OpenAI Passthrough”from deepintshield import DeepintShield
shield = DeepintShield(virtual_key="sk-bf-your-virtual-key")client = shield.openai(passthrough=True)
response = client.chat.completions.create( model="gpt-4o-mini", messages=[{"role": "user", "content": "hello from passthrough"}],)
print(response.choices[0].message.content)import openai
client = openai.OpenAI( base_url="https://app.deepintshield.com/openai_passthrough/v1", api_key="sk-bf-your-virtual-key", default_headers={"x-bf-vk": "sk-bf-your-virtual-key"},)
response = client.chat.completions.create( model="gpt-4o-mini", messages=[{"role": "user", "content": "hello from passthrough"}],)
print(response.choices[0].message.content)curl -X POST "https://app.deepintshield.com/openai_passthrough/v1/chat/completions" \ -H "content-type: application/json" \ -H "authorization: Bearer sk-your-openai-key" \ -H "x-bf-vk: sk-bf-your-virtual-key" \ -d '{ "model": "gpt-4o-mini", "messages": [{"role":"user","content":"hello from passthrough"}] }'Anthropic Passthrough
Section titled “Anthropic Passthrough”from deepintshield import DeepintShield
shield = DeepintShield(virtual_key="sk-bf-your-virtual-key")client = shield.anthropic(passthrough=True)
response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{"role": "user", "content": "hello from passthrough"}],)
print(response.content[0].text)import anthropic
client = anthropic.Anthropic( base_url="https://app.deepintshield.com/anthropic_passthrough", api_key="sk-bf-your-virtual-key", default_headers={"x-bf-vk": "sk-bf-your-virtual-key"},)
response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{"role": "user", "content": "hello from passthrough"}],)
print(response.content[0].text)curl -X POST "https://app.deepintshield.com/anthropic_passthrough/v1/messages" \ -H "content-type: application/json" \ -H "x-api-key: your-anthropic-key" \ -H "anthropic-version: 2023-06-01" \ -H "x-bf-vk: sk-bf-your-virtual-key" \ -d '{ "model": "claude-sonnet-4-20250514", "max_tokens": 1024, "messages": [{"role":"user","content":"hello from passthrough"}] }'GenAI Passthrough (Gemini)
Section titled “GenAI Passthrough (Gemini)”from deepintshield import DeepintShield
shield = DeepintShield(virtual_key="sk-bf-your-virtual-key")client = shield.genai(passthrough=True)
response = client.models.generate_content( model="gemini-2.5-flash", contents="hello from passthrough",)
print(response.text)from google import genaifrom google.genai.types import HttpOptions
client = genai.Client( api_key="sk-bf-your-virtual-key", http_options=HttpOptions( base_url="https://app.deepintshield.com/genai_passthrough", headers={"x-bf-vk": "sk-bf-your-virtual-key"}, ),)
response = client.models.generate_content( model="gemini-2.5-flash", contents="hello from passthrough",)
print(response.text)curl -X POST "https://app.deepintshield.com/genai_passthrough/v1beta/models/gemini-2.5-flash:generateContent" \ -H "content-type: application/json" \ -H "x-goog-api-key: your-gemini-key" \ -H "x-bf-vk: sk-bf-your-virtual-key" \ -d '{ "contents":[{"parts":[{"text":"hello from passthrough"}]}] }'GenAI Passthrough (Vertex-style request)
Section titled “GenAI Passthrough (Vertex-style request)”from google import genaifrom google.genai.types import HttpOptions
client = genai.Client( vertexai=True, api_key="sk-bf-your-virtual-key", http_options=HttpOptions( base_url="https://app.deepintshield.com/genai_passthrough", headers={"x-bf-vk": "sk-bf-your-virtual-key"}, ),)
response = client.models.generate_content( model="gemini-2.5-flash", contents="hello from vertex passthrough")
print(response.text)curl -X POST "https://app.deepintshield.com/genai_passthrough/v1/projects/my-project/locations/us-central1/publishers/google/models/gemini-2.5-flash:generateContent" \ -H "content-type: application/json" \ -H "authorization: Bearer ya29.your-vertex-token" \ -H "x-bf-vk: sk-bf-your-virtual-key" \ -d '{ "contents":[{"parts":[{"text":"hello from vertex passthrough"}]}] }'- Add your virtual key with the
x-bf-vkheader (or pass it as theapi_keywhen using the DeepintShield SDK) so the request is attributed for governance, logging, and observability. - The provider’s native authentication header (for example
authorization,x-api-key, orx-goog-api-key) is forwarded to the provider unchanged.