Skip to content

Authentication

All Glyph API requests require authentication using an API key. This guide covers how to obtain, use, and secure your API keys.

  1. Sign up at dashboard.glyph.you
  2. Navigate to API Keys in the sidebar
  3. Click Create New Key
  4. Copy your key immediately - it won’t be shown again

Glyph API keys follow a specific format:

gk_xxxxxxxxxxxxxxxxxxxx
  • Prefix: gk_ (Glyph Key)
  • Length: 27 characters total
  • Characters: Base64-safe (alphanumeric)

Include your API key in the Authorization header with the Bearer scheme:

Terminal window
curl -X POST https://api.glyph.you/v1/preview \
-H "Authorization: Bearer gk_your_api_key" \
-H "Content-Type: application/json" \
-d '{"template": "quote-modern", "data": {...}}'
const response = await fetch('https://api.glyph.you/v1/preview', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.GLYPH_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ template: 'quote-modern', data: quoteData })
});
import os
import requests
response = requests.post(
'https://api.glyph.you/v1/preview',
headers={
'Authorization': f'Bearer {os.environ["GLYPH_API_KEY"]}',
'Content-Type': 'application/json'
},
json={'template': 'quote-modern', 'data': quote_data}
)

When using the SDK, pass your API key to the component or client:

<glyph-editor api-key="gk_your_api_key" ...></glyph-editor>
import { GlyphAPI } from '@glyphpdf/sdk';
const api = new GlyphAPI('gk_your_api_key');
{
"error": "Missing Authorization header",
"code": "HTTP_ERROR"
}

HTTP Status: 401 Unauthorized

{
"error": "Invalid Authorization format. Use: Bearer <api_key>",
"code": "HTTP_ERROR"
}

HTTP Status: 401 Unauthorized

{
"error": "Invalid API key format. Keys should start with 'gk_'",
"code": "HTTP_ERROR"
}

HTTP Status: 401 Unauthorized

{
"error": "Invalid API key",
"code": "HTTP_ERROR"
}

HTTP Status: 401 Unauthorized

{
"error": "API key is deactivated",
"code": "HTTP_ERROR"
}

HTTP Status: 403 Forbidden

{
"error": "Monthly API limit exceeded (100 requests)",
"code": "HTTP_ERROR"
}

HTTP Status: 429 Too Many Requests

// BAD - Key exposed in frontend code
const api = new GlyphAPI('gk_live_key_here');
// GOOD - Key stored securely on backend
// Frontend makes request to your backend, which calls Glyph

Store keys in environment variables:

.env
GLYPH_API_KEY=gk_your_api_key
Node.js
const apiKey = process.env.GLYPH_API_KEY;

Periodically rotate your API keys:

  1. Create a new key in the dashboard
  2. Update your applications to use the new key
  3. Verify the new key works in production
  4. Revoke the old key

Use different keys for different environments:

EnvironmentKey Name
Developmentdev_key
Stagingstaging_key
Productionproduction_key

Your API key is associated with a pricing tier that determines:

  • Rate limits (requests per minute)
  • Monthly PDF generation limits
  • Feature access
TierRate LimitMonthly PDFs
Free10/min100
Pro60/min1,000
Scale120/min10,000
Enterprise300/minUnlimited

Check your current tier and usage in the dashboard.

In your dashboard, you can see:

  • Key prefix (first 11 characters)
  • Creation date
  • Last used date
  • Current tier

To revoke a key:

  1. Go to API Keys in your dashboard
  2. Find the key to revoke
  3. Click Revoke
  4. Confirm the action

Revoked keys immediately stop working for all requests.

Test if a key is valid:

Terminal window
curl https://api.glyph.you/v1/auth/validate \
-H "Authorization: Bearer gk_your_api_key"

Response:

{
"valid": true,
"tier": "pro"
}