Authentication

Learn how to authenticate your requests to Wictz API.

Authentication

All API requests to Wictz API must be authenticated. We use API keys to grant access to the API. You can manage your API keys from your API Keys dashboard.

API Key Authentication

Authentication to the API is performed via HTTP Bearer authentication. Provide your API key in the Authorization header when making requests.

Authorization Header Format
Authorization: Bearer YOUR_API_KEY

Replace YOUR_API_KEY with your actual secret API key.

Getting Your API Key

  1. Log in to your Wictz API account.
  2. Navigate to the API Keys section in your dashboard.
  3. Click on the "Generate New Key" button.
  4. Provide a descriptive name for your key (e.g., "My Application Key").
  5. Your new API key will be displayed. Copy this key immediately and store it in a secure location. It will not be shown again.

It is best practice to store API keys as environment variables in your application (e.g., WICTZ_API_KEY) rather than hardcoding them.

Example Request with Authentication

Here's how you would include your API key in a request using cURL:

curl -X POST https://wictz.com/api/v1/openai/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [
      {"role": "user", "content": "Hello, Wictz API!"}
    ]
  }'

Remember to replace YOUR_API_KEY or configure the environment variable WICTZ_API_KEY with your actual secret key.