API Reference

Authentication

How to authenticate your API requests

To use the API, you need to authenticate your requests. We provide an easy-to-use API Key mechanism.

Getting an API Key

  1. Log in to your account.
  2. Navigate to the API Keys section in your Console.
  3. Click on Create New Key.
  4. Keep this key safe. Do not share it publicly.

Using the API Key

You can pass the API key in the Authorization header as a Bearer token.

Example Request

curl -X POST "https://qxan.net/api/ai/images/generations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A futuristic city",
    "model": "runninghub-t2i-v1"
  }'

Error Codes

If your authentication fails, you will receive a 401 Unauthorized response:

{
  "error": {
    "message": "Unauthorized. Valid authentication is required to use this API.",
    "type": "unauthorized_error",
    "param": null,
    "code": 401
  }
}