ProductAIDocs
Get API Key

Getting Started

Authentication

Learn how to authenticate your API requests with ProductAI.

Getting your API key

To use the ProductAI API, you need an API key. You can get one from your dashboard:

  1. Log in to your ProductAI dashboard
  2. Navigate to API Access
  3. Your API key will be displayed (or you can generate a new one)
  4. Copy the key and store it securely

Using your API key

Include your API key in the x-api-key header of every API request:

Header
x-api-key: YOUR_API_KEY

Verify your key

The key-check endpoint does nothing but validate your key — useful as a smoke test when setting up:

cURL
curl "https://api.productai.photo/v1/api/key-check" \
  -H "x-api-key: YOUR_API_KEY"

# Response
{ "status": "OK" }

Security best practices

Never expose your API key

  • Don't commit API keys to version control
  • Don't include API keys in client-side code
  • Don't share API keys in public forums or chats

Recommended practices

  • Store API keys in environment variables
  • Use server-side code to make API requests
  • Rotate your API key periodically
  • Use different keys for development and production

Using environment variables

Store your API key in an environment variable to keep it secure:

// .env
PRODUCTAI_API_KEY=your_api_key_here

// app.js
const apiKey = process.env.PRODUCTAI_API_KEY;

fetch('https://api.productai.photo/v1/api/key-check', {
  headers: { 'x-api-key': apiKey }
});

Authentication errors

If authentication fails, you'll receive one of these error responses:

401Unauthorized
Missing API key — the response body is { "error": "API key is required" }. Check that you're sending the x-api-key header.
403Forbidden
The key is unknown or inactive. Generate a new one on the API Access page.