Skip to content
LLM-friendly formats:

Authentication

All API requests require authentication via Bearer token.

Get Your API Key

  1. Sign up at the Weyl platform
  2. Navigate to API Keys
  3. Create a new key
  4. Copy and securely store it (shown only once)

Using Your Key

Terminal window
export WEYL_API_KEY=wyl_sk_prod_1234567890abcdef

Then reference in your code:

Terminal window
curl -H "Authorization: Bearer $WEYL_API_KEY" ...

In Code

import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['WEYL_API_KEY']}"
}
resp = requests.post(url, headers=headers, json=payload)

Key Types

PrefixTypeUse Case
wyl_sk_prod_ProductionLive applications
wyl_sk_dev_DevelopmentTesting, staging environments
wyl_sk_test_TestRate-limited, for prototyping

Rate Limits

Rate limits vary by plan:

PlanSync (req/min)Async (req/min)Notes
Free1030Test keys only
Starter60300Burst to 120/min
Pro6003000Dedicated capacity
EnterpriseCustomCustomSLA, priority support

When rate limited, you’ll receive a 429 response with a Retry-After header.

Best Practices

Security

  • Never commit keys to version control
  • Use environment variables or secret managers
  • Rotate keys every 90 days
  • Use separate keys for dev/staging/prod

Error Handling

resp = requests.post(url, headers=headers, json=payload)
if resp.status_code == 401:
print("Invalid or expired API key")
elif resp.status_code == 429:
retry_after = int(resp.headers.get('Retry-After', 60))
print(f"Rate limited, retry in {retry_after}s")
else:
resp.raise_for_status()

Next Steps