API Key Authentication
Squadbase's API Key authentication provides secure access to deployed server-side applications.
Squadbase automatically adds API Key authentication protection to server-side applications built with frameworks like FastAPI deployed on Squadbase, without requiring additional code. This enables applications built with Streamlit, Next.js, and other frameworks to securely call server-side APIs.
Creating API Keys
You can create API Keys from the Squadbase dashboard. API Keys can be finely restricted to specific teams and projects they can be used with.
- Select "Manage account" from the dashboard's account settings menu.
- Select the API Keys tab and click the +Create button to create a new API Key with a name and select the team to use it with.
- Copy the created API Key.
Accessing Server-Side Applications with API Keys
To access applications using API Keys, you need to include the x-api-key
header in your HTTP requests to the deployed application.
This enables API Key authentication for secure access to your server-side APIs.
curl -X GET "https://your-subdomain.squadbase.app/" \
-H "x-api-key: your-api-key"
import requests
response = requests.get("https://your-subdomain.squadbase.app/", headers={"x-api-key": "your-api-key"})
print(response.json())
import axios from "axios";
const response = await axios.get("https://your-subdomain.squadbase.app/", {
headers: {
"x-api-key": "your-api-key",
},
});
console.log(response.data);
Accessing LLM APIs Deployed with Ollama
You can also use API Key authentication when using LLMs deployed with Ollama on Squadbase.
For detailed access methods, please refer to this page.