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.
Important Security Note
Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
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
- Log in to your Wictz API account.
- Navigate to the API Keys section in your dashboard.
- Click on the "Generate New Key" button.
- Provide a descriptive name for your key (e.g., "My Application Key").
- 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.
On this page
Navigate using the sidebar or scroll.