OpenAI
Requirements
Section titled “Requirements”- An OpenAI API key loaded into the TapPass vault by your platform team (
OPENAI_API_KEY). - Your
tp_key and the TapPass gateway URL.
Option A — SDK
Section titled “Option A — SDK”from tappass import Agent
agent = Agent("https://tappass.example.com", "tp_...")response = agent.chat("Hello", model="gpt-4o-mini")Option B — OpenAI SDK, zero-code
Section titled “Option B — OpenAI SDK, zero-code”export OPENAI_BASE_URL=https://tappass.example.com/v1export OPENAI_API_KEY=tp_...from openai import OpenAI
client = OpenAI() # picks up env varsresponse = client.chat.completions.create( model="gpt-4o-mini", messages=[{"role": "user", "content": "Hello"}],)What’s supported
Section titled “What’s supported”chat.completions(streaming + non-streaming)completions(legacy)embeddings- Tool calls / function calling
- Vision (
gpt-4o,gpt-4-turboimage inputs) - Structured outputs (JSON mode, schema-typed outputs)
What changes
Section titled “What changes”| Header | Purpose |
|---|---|
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=strict | Optional — per-request flag override |
Nothing else in the request changes — it’s the standard OpenAI schema.