Adaptive uses API keys for authentication. Get your API key from the dashboard and use it with any OpenAI-compatible client or HTTP library.

Getting Your API Key

1

Create Account

Sign up for free at llmadaptive.uk - no credit card required
2

Create Project

Create a new project or select an existing one from your dashboard
3

Generate API Key

Click “Generate API Key” and copy your key - you’ll need it for requests
4

Secure Storage

Store your API key securely using environment variables or your preferred secrets manager
Security: Never expose your API key in client-side code, version control, or public repositories. Always use environment variables or secure secret management systems.

Using Your API Key

HTTP Headers

Adaptive accepts standard OpenAI-compatible authentication headers:

SDK Integration

import OpenAI from "openai";

const openai = new OpenAI({
  apiKey: process.env.ADAPTIVE_API_KEY,
  baseURL: "https://www.llmadaptive.uk/api/v1"
});

const completion = await openai.chat.completions.create({
  model: "",
  messages: [{ role: "user", content: "Hello!" }]
});

Environment Variables

# .env
ADAPTIVE_API_KEY=your-adaptive-api-key-here

# Optional: For development vs production
ADAPTIVE_BASE_URL=https://www.llmadaptive.uk/api/v1

Rate Limits

Current Limits

Free Tier

100 requests/minute
Perfect for getting started and small projects

Pro Tier

1,000 requests/minute
For production applications and growing businesses

Enterprise

Custom limits
Contact us for high-volume requirements

Rate Limit Headers

Every response includes rate limit information:
{
  "x-ratelimit-limit": "1000",
  "x-ratelimit-remaining": "999",
  "x-ratelimit-reset": "1640995200"
}

Handling Rate Limits

async function makeRequestWithRetry(requestData, maxRetries = 3) {
  for (let attempt = 0; attempt < maxRetries; attempt++) {
    try {
      const completion = await openai.chat.completions.create(requestData);
      return completion;
    } catch (error) {
      if (error.status === 429) {
        // Rate limited - wait and retry
        const retryAfter = error.headers?.['retry-after'] || Math.pow(2, attempt);
        await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
        continue;
      }
      throw error; // Re-throw non-rate-limit errors
    }
  }
  throw new Error('Max retries exceeded');
}

Authentication Errors

Common Error Codes

401 Unauthorized

Cause: Invalid or missing API key
Solution: Check your API key and ensure it’s correctly set in headers

429 Too Many Requests

Cause: Rate limit exceeded
Solution: Implement retry logic with exponential backoff

403 Forbidden

Cause: API key doesn’t have required permissions
Solution: Check your subscription plan and key permissions

500 Server Error

Cause: Temporary server issue
Solution: Retry the request after a brief delay

Error Response Format

{
  "error": {
    "message": "Invalid API key provided",
    "type": "invalid_request_error",
    "code": "invalid_api_key"
  }
}

Security Best Practices

API Key Management

1

Use Environment Variables

Never hardcode API keys in your source code - always use environment variables
2

Rotate Keys Regularly

Generate new API keys periodically and update your applications
3

Limit Key Scope

Use separate API keys for development, staging, and production environments
4

Monitor Usage

Regularly check your API usage and set up alerts for unusual activity

Security Checklist

✅ Do This

Store keys in environment variables
Use HTTPS for all requests
Rotate keys regularly
Monitor API usage patterns
Set up usage alerts

❌ Avoid This

Hardcode keys in source code
Commit keys to version control
Share keys in chat/email
Use production keys in development
Ignore unusual usage patterns

Multiple API Keys

Managing Multiple Keys

// Use different keys for different environments
const getApiKey = () => {
  const env = process.env.NODE_ENV || 'development';
  return {
    development: process.env.ADAPTIVE_API_KEY_DEV,
    staging: process.env.ADAPTIVE_API_KEY_STAGING,
    production: process.env.ADAPTIVE_API_KEY_PROD
  }[env];
};

const openai = new OpenAI({
  apiKey: getApiKey(),
  baseURL: "https://www.llmadaptive.uk/api/v1"
});

Troubleshooting

Common Authentication Issues

Next Steps