API Authentication

Learn how to authenticate your API requests to securely access VectorForgeAI services.

Authentication Overview

All API requests to VectorForgeAI require authentication using API keys and Team Tokens. This ensures that only authorized users can access their data and resources within the correct team context.

Required Headers

To authenticate your requests, you need to include your API key and Team Token in the HTTP request headers.

Authorization Header
Header Format
Authorization: Bearer YOUR_API_KEY
Team Token Header
Header Format
Team-Token: YOUR_TEAM_TOKEN

Obtaining Your API Key

You can obtain your API key from your VectorForgeAI Dashboard. Follow these steps:

  1. Log in to your VectorForgeAI account
  2. Navigate to the API Settings section in your dashboard
  3. Click "Generate API Key" to create a new API key
  4. Copy your API key and store it securely

Obtaining Your Team Token

Each team has a unique Team Token that must be included with API requests. To find your Team Token:

  1. Log in to your VectorForgeAI account
  2. Hover over your current Team name in the dashboard
  3. Select "Team Settings" from the dropdown menu
  4. Scroll to the bottom of the Team Settings page to find your Team Token

⚠️ API Key & Team Token Security

Your API key and Team Token grant access to your account and team data. Never share these credentials or expose them in client-side code. Always make API requests from your server to protect your credentials.

Understanding Teams

Teams in VectorForgeAI provide a way to organize your work and resources:

  • Environments: Teams can be used as different environments (e.g., development, staging, production)
  • Organizations: If you work with multiple companies (common for consultants), each can have its own team
  • Billing: Billing is per-team, with free trial and free plan options available for local/staging environments
  • Access Control: Each team has its own data and resources, isolated from other teams

API Key Management

Best practices for API key and Team Token management include:

  • Rotate your API keys periodically
  • Use different teams for development and production environments
  • Store API keys and Team Tokens in environment variables, not in your code
  • Implement rate limiting to prevent abuse
  • Monitor API usage for suspicious activities

Example Request with Authentication

Here's an example of how to make an authenticated API request using cURL:

cURL
curl -X GET https://api.vectorforgeai.com/v1/collections \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Team-Token: YOUR_TEAM_TOKEN" \
  -H "Content-Type: application/json"

Authentication Errors

If authentication fails, the API will return a 401 Unauthorized response:

JSON
{
  "error": "Unauthorized. Invalid API key."
}

Team Token Errors

If an invalid Team Token is used (or none is used), the API will return either a 422 error with "Team-Token header is required." or "Team not found.":

JSON
{
  "error": "Team-Token header is required."
}

Next Steps

Now that you understand authentication, you're ready to explore the VectorForgeAI API.

Need Help?

If you're having trouble with authentication or have questions, we're here to help!