All API requests require authentication using your project's API key.
Include your API key in the request headers using the x-api-key header:
x-api-key: <YOUR_API_KEY>Each project has an automatically generated API key. To access it:
curl https://superprompts.app/api/v1/prompts/<PROMPT_ID> \
  -H "x-api-key: pk_abc123def456ghi789"const response = await fetch(
  'https://superprompts.app/api/v1/prompts/<PROMPT_ID>',
  {
    headers: {
      'x-api-key': 'pk_abc123def456ghi789'
    }
  }
);
const data = await response.json();
console.log(data.content);import requests
response = requests.get(
    'https://superprompts.app/api/v1/prompts/<PROMPT_ID>',
    headers={'x-api-key': 'pk_abc123def456ghi789'}
)
data = response.json()
print(data['content'])import axios from 'axios';
const response = await axios.get(
  'https://superprompts.app/api/v1/prompts/<PROMPT_ID>',
  {
    headers: {
      'x-api-key': 'pk_abc123def456ghi789'
    }
  }
);
console.log(response.data.content);Never commit your API key to version control or expose it in client-side code. Always use environment variables.
Store your API key in environment variables:
# .env file
SUPERPROMPTS_API_KEY=pk_abc123def456ghi789Then access it in your code:
const apiKey = process.env.SUPERPROMPTS_API_KEY;Always make API requests from your server, never from client-side JavaScript. This prevents exposing your API key to users.
If you suspect your API key has been compromised, regenerate it immediately from your project settings.
If you don't include the x-api-key header:
HTTP/1.1 401 Unauthorized
{
  "error": "API key is required"
}If your API key is invalid or has been revoked:
HTTP/1.1 401 Unauthorized
{
  "error": "Invalid API key"
}