{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Data Bridge: Multi-Database Connector",
    "description": "Stop juggling 7 different database tools. AI DataBridge connects PostgreSQL, MySQL, MongoDB, Airtable, Notion, and Google Sheets through a single MCP interface. Ask questions in plain English—get answers from any database instantly.\nAI database connector, multi-database integration",
    "version": "1.0",
    "x-build-id": "o86HWq7d5ZedFGN9r"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/the.beast~ai-data-bridge/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-the.beast-ai-data-bridge",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/the.beast~ai-data-bridge/runs": {
      "post": {
        "operationId": "runs-sync-the.beast-ai-data-bridge",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/the.beast~ai-data-bridge/run-sync": {
      "post": {
        "operationId": "run-sync-the.beast-ai-data-bridge",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "operation"
        ],
        "properties": {
          "operation": {
            "title": "Operation",
            "enum": [
              "query",
              "list_sources",
              "describe_schema",
              "natural_language_query",
              "test_connection"
            ],
            "type": "string",
            "description": "The database operation to perform.",
            "default": "natural_language_query"
          },
          "naturalLanguageQuery": {
            "title": "Natural Language Query",
            "type": "string",
            "description": "Ask your question in plain English. Example: 'Show me all customers who signed up last month' or 'Get the top 10 products by sales from my Airtable'."
          },
          "dataSource": {
            "title": "Data Source Type",
            "enum": [
              "postgresql",
              "mysql",
              "sqlite",
              "mongodb",
              "airtable",
              "notion",
              "google_sheets"
            ],
            "type": "string",
            "description": "The type of database or data source to connect to.",
            "default": "postgresql"
          },
          "connectionString": {
            "title": "Connection String",
            "type": "string",
            "description": "Database connection string. For PostgreSQL: postgresql://user:pass@host:5432/db. For MySQL: mysql://user:pass@host:3306/db. For MongoDB: mongodb+srv://user:pass@cluster.mongodb.net/db"
          },
          "airtableApiKey": {
            "title": "Airtable API Key",
            "type": "string",
            "description": "Your Airtable Personal Access Token. Get it from airtable.com/account"
          },
          "airtableBaseId": {
            "title": "Airtable Base ID",
            "type": "string",
            "description": "The ID of your Airtable base (starts with 'app...'). Find it in your base URL."
          },
          "airtableTableName": {
            "title": "Airtable Table Name",
            "type": "string",
            "description": "The name of the table within your Airtable base."
          },
          "notionToken": {
            "title": "Notion Integration Token",
            "type": "string",
            "description": "Your Notion integration token (starts with 'ntn_' or 'secret_'). Create one at notion.so/my-integrations"
          },
          "notionDatabaseId": {
            "title": "Notion Database ID",
            "type": "string",
            "description": "The ID of your Notion database. Find it in the database URL after the workspace name."
          },
          "googleSheetsCredentials": {
            "title": "Google Sheets Service Account JSON",
            "type": "string",
            "description": "The JSON content of your Google Service Account credentials. Create one in Google Cloud Console > IAM > Service Accounts."
          },
          "googleSpreadsheetId": {
            "title": "Google Spreadsheet ID",
            "type": "string",
            "description": "The ID of your Google Spreadsheet. Find it in the URL: docs.google.com/spreadsheets/d/{SPREADSHEET_ID}/edit"
          },
          "googleSheetName": {
            "title": "Google Sheet Name",
            "type": "string",
            "description": "The name of the specific sheet within the spreadsheet (e.g., 'Sheet1').",
            "default": "Sheet1"
          },
          "sqlQuery": {
            "title": "SQL Query",
            "type": "string",
            "description": "Direct SQL query to execute (for SQL databases). Example: SELECT * FROM users LIMIT 10"
          },
          "mongoQuery": {
            "title": "MongoDB Query",
            "type": "string",
            "description": "MongoDB query as JSON. Example: {\"status\": \"active\"}"
          },
          "mongoCollection": {
            "title": "MongoDB Collection",
            "type": "string",
            "description": "The name of the MongoDB collection to query."
          },
          "tableName": {
            "title": "Table/Collection Name",
            "type": "string",
            "description": "The name of the table or collection to describe (for describe_schema operation)."
          },
          "limit": {
            "title": "Result Limit",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of rows/records to return.",
            "default": 100
          },
          "aiApiKey": {
            "title": "AI API Key (OpenRouter)",
            "type": "string",
            "description": "OpenRouter API key for natural language query processing. Get it from openrouter.ai"
          },
          "aiModel": {
            "title": "AI Model",
            "enum": [
              "anthropic/claude-sonnet-4",
              "openai/gpt-4o",
              "openai/gpt-4o-mini",
              "google/gemini-2.0-flash-exp:free"
            ],
            "type": "string",
            "description": "The AI model to use for natural language processing.",
            "default": "google/gemini-2.0-flash-exp:free"
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}