Skip to main content

Overview

BoostGPT uses API keys to authenticate requests. You’ll need two pieces of information:

API Key

Used to authenticate all API requests

Project ID

Identifies which project you’re working with

Getting Your Credentials

1

Create an account

Sign up at app.boostgpt.co if you haven’t already.
2

Create a project

Create a new project from your dashboard. Each project is isolated with its own bots and data.
3

Get your Project ID

Go to your project settings to find your Project ID. You can also find it at app.boostgpt.co/settings.
4

Generate an API key

Navigate to API Keys and click “Generate New Key”. Copy it immediately - you won’t be able to see it again.
Keep your API key secure! Never commit it to version control or share it publicly.

Using Environment Variables

The recommended way to store your credentials is using environment variables. Create a .env file in your project root:
.env
BOOSTGPT_API_KEY=your_api_key_here
BOOSTGPT_PROJECT_ID=your_project_id_here
Add .env to your .gitignore:
.gitignore
.env
node_modules/
Load environment variables in your code:
import 'dotenv/config';

const apiKey = process.env.BOOSTGPT_API_KEY;
const projectId = process.env.BOOSTGPT_PROJECT_ID;

SDK Authentication

Core SDK

import { BoostGPT } from 'boostgpt';

const client = new BoostGPT({
  key: process.env.BOOSTGPT_API_KEY,
  project_id: process.env.BOOSTGPT_PROJECT_ID
});

Router SDK

import { Router } from '@boostgpt/router';

const router = new Router({
  apiKey: process.env.BOOSTGPT_API_KEY,
  projectId: process.env.BOOSTGPT_PROJECT_ID,
  // ... adapters
});
The Router SDK uses apiKey (camelCase) while the Core SDK uses key. Both accept the same API key value.

REST API Authentication

When making direct REST API calls, include your API key in the Authorization header:
curl https://api.boostgpt.co/v1/bot/read \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "YOUR_PROJECT_ID",
    "bot_id": "YOUR_BOT_ID"
  }'

Multiple Projects

If you’re working with multiple projects, you can create separate clients:
const productionClient = new BoostGPT({
  key: process.env.BOOSTGPT_API_KEY_PROD,
  project_id: process.env.BOOSTGPT_PROJECT_ID_PROD
});

const stagingClient = new BoostGPT({
  key: process.env.BOOSTGPT_API_KEY_STAGING,
  project_id: process.env.BOOSTGPT_PROJECT_ID_STAGING
});

Best Practices

Always use environment variables or a secrets manager. Never commit API keys to git.
Generate new API keys periodically and revoke old ones from your dashboard.
Use different API keys for development, staging, and production.
Only give API keys to team members who need them. Track which keys are used where.

Managing API Keys

You can manage your API keys from the API Keys dashboard:
  • Generate new keys - Create additional API keys for different environments
  • Revoke keys - Immediately disable compromised or unused keys
  • View usage - See which keys are being used and when
Revoking an API key will immediately break any applications using it. Make sure to update your applications before revoking keys.

Rate Limits

BoostGPT applies rate limits to ensure fair usage:

Free Tier

1,000 requests per day

Paid Plans

Higher limits based on your plan
If you hit rate limits, you’ll receive a 429 Too Many Requests response. Implement exponential backoff in your retry logic:
async function makeRequestWithRetry(requestFn, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    try {
      return await requestFn();
    } catch (error) {
      if (error.status === 429 && i < maxRetries - 1) {
        const delay = Math.pow(2, i) * 1000; // Exponential backoff
        await new Promise(resolve => setTimeout(resolve, delay));
        continue;
      }
      throw error;
    }
  }
}

Troubleshooting

Your API key is invalid or missing. Double-check that you’re using the correct key and it hasn’t been revoked.
Your API key doesn’t have access to the requested resource. Verify you’re using the correct Project ID.
You’ve exceeded your rate limit. Implement retry logic with exponential backoff or upgrade your plan.

Next Steps