The OpenAI provider integration lets you use Metorial’s MCP tools with OpenAI’s GPT models, including GPT-4 and GPT-3.5. The integration handles converting Metorial tools into OpenAI’s function calling format and processing tool call responses. You’ll need both a Metorial API key and an OpenAI API key to use this integration. The Metorial SDK manages your provider connections, while the OpenAI SDK handles the model interactions. What this example does:Documentation Index
Fetch the complete documentation index at: https://metorial.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
- Initializes both Metorial and OpenAI clients
- Creates a Metorial session that provides tools in OpenAI’s format
- Passes those tools to OpenAI’s chat completions API
- Provides a
callToolsfunction to execute any tool calls the model requests