Using the SLURX API
The SLURX API allows you to validate content against ethical benchmarks. This guide explains how to use the API.
Authentication
All API requests require an API key for authentication. Include your API key in the request headers.
You can obtain an API key by registering on the SLURX platform. Store your API key securely and never expose it in client-side code.
API Endpoint
All API requests should be sent to the following endpoint:
Making a Request
HTTP Method
Use the POST method for all API requests.
Headers
Include these headers with every request:
| Header | Value | Description |
|---|---|---|
| Content-Type | application/json | Specifies the request body format |
| X-Api-key | YOUR_API_KEY | Your API authentication key |
Request Body
The request body must be a JSON object with the following parameter:
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | String | Yes | The content to validate against ethical benchmarks |
Response Format
The API returns a JSON response with validation results. The structure will depend on the specific validation performed.
A successful response will have a 200 status code. Error responses will have appropriate HTTP status codes (400 for bad requests, 401 for authentication issues, etc.).
Example Implementation
Here's an example of how to call the API using curl:
Note: When using the API in a frontend application, consider making the request from your backend to keep your API key secure.