> For the complete documentation index, see [llms.txt](https://docs.talordata.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.talordata.com/serp-api/integration/mcp-integration/openai-sdk-integration.md).

# OpenAI SDK Integration

Connect the OpenAI SDK to the TalorData MCP server to enable GPT-4o and o-series models to perform real-time web searches, scraping, and structured data access.

### Hosted MCP

{% stepper %}
{% step %}

#### Get your API token

* Go to [SERP API-API Token](https://dashboard.talordata.com/scraping/serp-api/api-token/) to create an API token.
* Copy your API Token (format as: `sk_7qBRe***************************`）

{% endstep %}

{% step %}

#### Configure your MCP server

```
from openai import OpenAI

client = OpenAI()

resp = client.responses.create(
  model="gpt-4o",
  tools=[
    {
      "type": "mcp",
      "server_label": "TalorData",
      "server_url": "https://mcp.talordata.net/API_TOKEN/mcp",
      "require_approval": "never",
    },
  ],
  input="What is the weather in Paris ?",
)

print(resp.output_text)
```

{% endstep %}

{% step %}

#### Testing to see if it works.

* Ask your AI: "Can you use Google to search for 'today's weather'?"
* The AI ​​will request permission—click "Allow."
* You should be able to see results!

{% endstep %}

{% step %}

#### Monitor usage

* View your API usage in the [**TalorData SERP API usage logs**](https://dashboard.talordata.com/scraping/serp-api/history).

{% endstep %}
{% endstepper %}
