Integration

OpenAI Integration

Use SearchHive as a tool with OpenAI GPT models for function calling and web-augmented responses.

Features

Function calling definition
Assistants API compatible
Streaming support
GPT-4 and GPT-4o support
JSON mode output

Quick Start

import OpenAI from 'openai'
import { SearchHive } from '@searchhive/sdk'

const openai = new OpenAI()
const searchhive = new SearchHive({ apiKey: process.env.SEARCHHIVE_API_KEY })

const tools = [{
  type: 'function',
  function: {
    name: 'web_search',
    description: 'Search the web for current information',
    parameters: {
      type: 'object',
      properties: {
        query: { type: 'string' }
      }
    }
  }
}]

const response = await openai.chat.completions.create({
  model: 'gpt-4o',
  messages: [{ role: 'user', content: 'What happened in tech today?' }],
  tools
})

Benefits

Direct GPT integration
Function calling native
Assistants API ready
Structured output support
Production-tested

Start integrating today

Free tier includes 1,000 API calls/month.