Skip to content

OpenAI

  • An OpenAI API key loaded into the TapPass vault by your platform team (OPENAI_API_KEY).
  • Your tp_ key and the TapPass gateway URL.
from tappass import Agent
agent = Agent("https://tappass.example.com", "tp_...")
response = agent.chat("Hello", model="gpt-4o-mini")
Terminal window
export OPENAI_BASE_URL=https://tappass.example.com/v1
export OPENAI_API_KEY=tp_...
from openai import OpenAI
client = OpenAI() # picks up env vars
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hello"}],
)
  • chat.completions (streaming + non-streaming)
  • completions (legacy)
  • embeddings
  • Tool calls / function calling
  • Vision (gpt-4o, gpt-4-turbo image inputs)
  • Structured outputs (JSON mode, schema-typed outputs)
HeaderPurpose
Authorization: Bearer tp_...Your TapPass key — replaces the OpenAI key
X-Agent-Id: <your-agent>Optional — attaches audit events to an agent
X-Governance-Flags: mode=strictOptional — per-request flag override

Nothing else in the request changes — it’s the standard OpenAI schema.