Skip to content

Passthrough

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.


  • /openai_passthrough Default provider: openai
  • /anthropic_passthrough Default provider: anthropic
  • /genai_passthrough Default provider: gemini (with automatic Vertex detection for clients configured to use Vertex)

  1. Send your request to a passthrough endpoint (OpenAI, Anthropic, or GenAI passthrough).
  2. The integration strips the passthrough prefix and forwards the remaining provider-native path/body.
  3. DeepintShield handles provider execution through core inference and plugin pipelines.
  4. Response status, headers, and body are returned as passthrough output (for both stream and non-stream requests).

  • Uses openai as the default provider.
  • Uses anthropic as the default provider.
  • Uses gemini by default.
  • Automatically switches to vertex when Vertex patterns are detected, such as:
    • URL path containing /projects/{PROJECT_ID}/locations/{LOCATION}/
    • Request body model containing a Vertex resource path
    • OAuth token pattern typically used for Vertex (Bearer ya29...)

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)
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)
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 genai
from 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)

  • Use passthrough when you need a provider endpoint that is not directly supported by DeepintShield integration routes yet.