BAIS API Documentation
Technical documentation for integrating with our platform. Most businesses don't need this - we handle the integration for you.
Get Started in Minutes
Authentication
Get your API key and start making requests
curl -X GET "https://api.baintegrate.com/v1/health" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
Base URL
All API requests are made to our secure endpoint
BAIS API Endpoints
Core endpoints for agent-business integration using the BAIS protocol
Process BAIS agent requests for business operations including search, book, modify, and cancel operations.
Request Body
{
"prompt": "Book a room for 2 guests for 3 nights",
"businessType": "hotel",
"requestType": "book",
"userPreferences": "Non-smoking room, ground floor"
}
Get the current status of the BAIS API service and connected systems.
List available AI models for agent processing.
Health check endpoint for monitoring and status verification.
Multi-AI Provider Support
Choose from leading AI providers or let BAIS automatically select the best model for your use case
OpenAI (ChatGPT)
GPT-4, GPT-3.5, and other OpenAI models for advanced reasoning and conversation
Google (Gemini)
Gemini Pro and other Google AI models for fast, efficient processing
Anthropic (Claude)
Claude 3 Sonnet and other Anthropic models for reliable, safe AI interactions
Ollama (Local)
Local AI models for privacy-sensitive operations and offline capabilities
Automatic Provider Selection
BAIS can automatically choose the best AI provider based on your request type:
- Transaction-heavy operations: Claude (for reliability)
- Product search: GPT-4 (for reasoning)
- Quick responses: Gemini (for speed)
- Privacy-sensitive: Ollama (for local processing)
Supported Business Categories
BAIS supports standardized integration with these business types
Hotel
Hospitality businesses including hotels, lodges, and accommodations
- Example: Zion Adventure Lodge
- Operations: search, book, modify, cancel
- Services: Rooms, Restaurant, Activities
Restaurant
Food service businesses including restaurants, cafes, and catering
- Example: Red Canyon Brewing
- Operations: search, book, modify, cancel
- Services: Dining, Catering, Events
Retail
Retail businesses including shops, stores, and e-commerce
- Example: Desert Pearl Gifts
- Operations: search, book
- Services: Gifts, Souvenirs, Local Crafts
BAIS Request Types
Standardized operations that AI agents can perform with businesses
Search
Find available products, services, or inventory based on criteria
Book
Make reservations, bookings, or place orders for products/services
Modify
Update existing bookings, reservations, or orders
Cancel
Cancel bookings, reservations, or orders according to policies
Standardized API Responses
All BAIS API responses follow a consistent format for easy integration
Success Response
{
"success": true,
"data": {
"response": "Room booked successfully for 2 guests, 3 nights starting March 15th",
"metadata": {
"model": "gpt-oss:120b",
"businessType": "hotel",
"requestType": "book",
"processingTime": 1250,
"aiProvider": "ollama",
"timestamp": "2025-01-27T10:30:00Z"
}
}
}
Error Response
{
"success": false,
"error": "Validation failed",
"details": [
{
"field": "businessType",
"message": "Business type must be hotel, restaurant, or retail",
"value": "invalid_type"
}
]
}
SDKs & Libraries
Official SDKs and libraries to accelerate your integration development
JavaScript/Node.js
Official SDK for web and Node.js applications with multi-AI provider support
npm install @baintegrate/sdk
import { BAISClient } from '@baintegrate/sdk';
const client = new BAISClient('your-api-key');
// Use ChatGPT
await client.chat({ prompt: 'Book a room', aiProvider: 'openai' });
// Use Gemini
await client.chat({ prompt: 'Book a room', aiProvider: 'google' });
// Use Claude
await client.chat({ prompt: 'Book a room', aiProvider: 'anthropic' });
Python
Python SDK for server-side integrations with AI provider selection
pip install baintegrate-sdk
from baintegrate import BAISClient
client = BAISClient('your-api-key')
# Specify AI provider
response = client.chat({
'prompt': 'Book a room for 2 guests',
'businessType': 'hotel',
'aiProvider': 'openai' # or 'google', 'anthropic', 'ollama'
})
cURL Examples
Direct HTTP API calls for any language with AI provider selection
curl -X POST "https://api.baintegrate.com/v1/agent/chat" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Book a room for 2 guests",
"businessType": "hotel",
"requestType": "book",
"aiProvider": "openai"
}'
Ready to Integrate?
Get your API key and start building with the BAIS protocol