Passthrough
Overview
Section titled “Overview”Passthrough integrations let you call provider-native API paths and payloads through DeepintShield without route-level request/response conversion.
When you use passthrough endpoints, the request still flows through DeepintShield core logic. You keep DeepintShield features such as logging and observability while sending provider-native paths and bodies.
Endpoints
Section titled “Endpoints”/openai_passthroughDefault provider:openai/anthropic_passthroughDefault provider:anthropic/genai_passthroughDefault provider:gemini(with automatic Vertex detection for clients configured to use Vertex)
How It Works
Section titled “How It Works”- Send your request to a passthrough endpoint (OpenAI, Anthropic, or GenAI passthrough).
- The integration strips the passthrough prefix and forwards the remaining provider-native path/body.
- DeepintShield handles provider execution through core inference and plugin pipelines.
- Response status, headers, and body are returned as passthrough output (for both stream and non-stream requests).
Provider Selection Rules
Section titled “Provider Selection Rules”OpenAI Passthrough
Section titled “OpenAI Passthrough”- Uses
openaias the default provider.
Anthropic Passthrough
Section titled “Anthropic Passthrough”- Uses
anthropicas the default provider.
GenAI Passthrough
Section titled “GenAI Passthrough”- Uses
geminiby default. - Automatically switches to
vertexwhen Vertex patterns are detected, such as:- URL path containing
/projects/{PROJECT_ID}/locations/{LOCATION}/ - Request body
modelcontaining a Vertex resource path - OAuth token pattern typically used for Vertex (
Bearer ya29...)
- URL path containing
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="dummy-key", http_options=HttpOptions(base_url="http://localhost:8080/genai_passthrough"))
response = client.models.generate_content( model="gemini-2.5-flash", contents="hello from vertex passthrough")
print(response.text)curl -X POST "http://localhost:8080/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" \ -d '{ "contents":[{"parts":[{"text":"hello from vertex passthrough"}]}] }'- Use passthrough when you need a provider endpoint that is not directly supported by DeepintShield integration routes yet.