Documentation
Back to Docs

Authentication

All API requests require authentication using an API key.

API Keys

API keys are used to authenticate requests to the CS2Cap API. You can manage your API keys in your account dashboard.

Key Types

TypePrefixUsage
Livecs2cap_live_Production environment
Testcs2cap_test_Development/testing

Using Your API Key

Include your API key in the Authorization header of every request:

Authorization: Bearer YOUR_API_KEY

Example Request

cURL
curl -X GET "https://api.cs2cap.com/v1/items/ak47-redline-ft" \
  -H "Authorization: Bearer cs2cap_live_xxxxxxxxxxxx" \
  -H "Content-Type: application/json"

Security Best Practices

  • Never expose your API keys in client-side code or public repositories
  • Use environment variables to store your keys securely
  • Rotate your keys periodically and immediately if compromised
  • Use test keys during development and live keys only in production

Authentication Errors

If authentication fails, the API returns one of these error codes:

StatusCodeDescription
401unauthorizedMissing or invalid API key
403forbiddenKey lacks required permissions
429rate_limitedRate limit exceeded