The Respan gateway supports OpenAI's Responses API, enabling automatic logging and observability for text inputs, image inputs, file search, function calling, web search, and streaming responses.
The integration works as a pass-through - modify your client's base URL and pass Respan parameters via a custom header. All standard Responses API features are supported including reasoning models and stateful interactions.
Point your OpenAI client to the Respan gateway base URL (https://api.keywordsai.co/api) and use your Respan API key for authentication.
Pass Respan-specific parameters like customer_identifier and metadata through the X-Data-Keywordsai-Params header as base64-encoded JSON. Every request is logged with full observability.
python
from openai import OpenAI
import json, base64
client = OpenAI(
base_url="https://api.keywordsai.co/api",
api_key="YOUR_RESPAN_API_KEY",
)
# Pass Respan params via header
params = json.dumps({"customer_identifier": "user-123"})
encoded = base64.b64encode(params.encode()).decode()
response = client.responses.create(
model="gpt-4o",
input="Explain quantum computing",
extra_headers={"X-Data-Keywordsai-Params": encoded},
)