OpenAI API
Use remote MCP through the Responses API.
Configure this client in Quick Start.
Before you start
Prepare a Python environment, OpenAI API credentials, and a DINQ API Key. Install the SDK before running the example, and keep both credentials out of source control.
See Authentication and API Keys for credential options. Merge only the peoplerouter entry into an existing configuration; do not overwrite other settings.
Set up the connection
Install the SDK and set OPENAI_API_KEY in your environment. The DINQ key below is a separate credential; this API example does not open an interactive OAuth login.
pip install -U openaifrom openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-5",
tools=[{
"type": "mcp",
"server_label": "peoplerouter",
"server_url": "https://mcp.peoplerouter.ai",
"headers": {"Authorization": "Bearer <DINQ_API_KEY>"},
"require_approval": "never",
}],
input="Who maintains https://github.com/vllm-project/vllm? Enrich the top five.",
)
print(response.output_text)Or send this to your agent
Copy these instructions into your agent to help with setup.
Connect PeopleRouter in OpenAI API. Check the installed version first and use this setup:
agent.py
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-5",
tools=[{
"type": "mcp",
"server_label": "peoplerouter",
"server_url": "https://mcp.peoplerouter.ai",
"headers": {"Authorization": "Bearer <DINQ_API_KEY>"},
"require_approval": "never",
}],
input="Who maintains https://github.com/vllm-project/vllm? Enrich the top five.",
)
print(response.output_text)
Install the SDK and set OPENAI_API_KEY in your environment. The DINQ key below is a separate credential; this API example does not open an interactive OAuth login.
If an API key is needed, guide me to configure it locally rather than paste it into chat. If sandbox restrictions block configuration or authorization through file, network or browser callback access, request the necessary permissions through the current agent's approval mechanism. Where outside-sandbox execution is supported, run the operation only after approval. I will complete browser authorization. Do not repeatedly retry in the same restricted environment, disable the sandbox or bypass approvals. If the environment cannot request permission, give me the exact steps to perform in my local terminal or app UI. Back up existing configuration and merge only peoplerouter, preserving other servers and settings. Check an existing entry instead of adding a duplicate. Web apps require adding the connector in their UI; guide me if you cannot do that directly. Confirm success only after tools load and capabilities succeeds; otherwise report the actual error.This example needs an API Key. Create one in the console and enable it in developer settings. Authentication and API Keys
Check the connection
The SDK / HTTP examples use the capabilities response to check the connection. The API examples may continue with a people search: review the input and tool prices before running them. An HTTP success status alone does not establish a successful tool result.
After connecting, continue to Using tools. For authentication or tool errors, read Troubleshooting and inspect the client's actual error message.