Quickstart
This guide will help you get started with Gateway using Docker, discover your database and launch API on top of it.
Prerequisites
- OpenAI API key for AI-powered API generation
- Your PostgreSQL Database or any other db that gateway supports. You can also take our example databases:
Installation and Launching Steps
1. Binary Installation
Choose your operating system below for specific installation instructions for Linux:
# Download the latest binary for Linuxwget https://github.com/centralmind/gateway/releases/latest/download/gateway-linux-amd64.tar.gz
# Extract the archivetar -xzf gateway-linux-amd64.tar.gzmv gateway-linux-amd64 gateway
# Make the binary executablechmod +x gateway
Windows (Intel)
# Download the latest binary for WindowsInvoke-WebRequest -Uri https://github.com/centralmind/gateway/releases/latest/download/gateway-windows-amd64.zip -OutFile gateway-windows.zip
# Extract the archiveExpand-Archive -Path gateway-windows.zip -DestinationPath .
# RenameRename-Item -Path "gateway-windows-amd64.exe" -NewName "gateway.exe"
macOS (Intel)
# Download the latest binary for macOS (Intel)curl -LO https://github.com/centralmind/gateway/releases/latest/download/gateway-darwin-amd64.tar.gz
# Extract the archivetar -xzf gateway-darwin-amd64.tar.gzmv gateway-darwin-amd64 gateway
# Make the binary executablechmod +x gateway
macOS (Apple Silicon)
# Download the latest binary for macOS (Apple Silicon)curl -LO https://github.com/centralmind/gateway/releases/latest/download/gateway-darwin-arm64.tar.gz
# Extract the archive
tar -xzf gateway-darwin-arm64.tar.gzmv gateway-darwin-arm64 gateway
# Make the binary executable
chmod +x gateway
2. Create a connection.yaml
configuration file:
echo 'type: postgreshosts: - localhostuser: "your-database-user"password: "your-database-password"database: "your-database-name"port: 5432' > connection.yaml
3. Choose one of our supported AI providers:
- OpenAI and all OpenAI-compatible providers
- Anthropic
- Amazon Bedrock
- Google Vertex AI (Anthropic)
- Google Gemini
Google Gemini provides a generous free tier. You can obtain an API key by visiting Google AI Studio:
Once logged in, you can create an API key in the API section of AI Studio. The free tier includes a generous monthly token allocation, making it accessible for development and testing purposes.
Configure AI provider authorization. For Google Gemini, set an API key.
export GEMINI_API_KEY='yourkey'
4. Run the discovery process with AI-powered API generation:
./gateway discover \ --ai-provider gemini \ --config connection.yaml \ --prompt "Develop an API that enables a chatbot to retrieve information about data. \Try to place yourself as analyst and think what kind of data you will require, \based on that come up with useful API methods for that"
4. Start the REST server:
./gateway --config gateway.yaml start rest
Verification
After starting the REST server, you can verify the installation by accessing the Swagger UI:
http://localhost:9090/swagger/