# Authentication

## API Authentication Guide

To ensure secure access, all API endpoints mandate authentication. This process involves providing credentials that verify your identity and allow you to interact with the services.

### Authentication Method

Our APIs utilize an API Token for authentication purposes. This token must be included in every request you send to an API endpoint to verify that you have the necessary permissions.

### How to Authenticate

To authenticate your requests, the API Token should be placed in the Authorization header of your HTTP request. The token must be prefixed with the word `Bearer`, separated by a space. This format is known as Bearer Authentication.

```http
Authorization: Bearer LUW_API_TOKEN
```

Replace `LUW_API_TOKEN` with the actual token provided to you upon registration or via authentication processes.

### Importance of Secure Authentication

Using an API Token ensures that your interactions with the API are both authenticated and securely encrypted. Bearer Authentication is widely used for its ability to maintain session security without transmitting sensitive credentials.

By following these guidelines, you can securely authenticate and use our API endpoints effectively. If you encounter any issues, please refer to our detailed API documentation or reach out to support for assistance.

### ⚠️ How to get API token?

[Click here](https://app.luw.ai/dashboard/api) or visit <https://app.luw.ai/dashboard/api> to obtain your `LUW_API_TOKEN` parameter.

**Example usage of Bearer Token**

```bash
curl -H "Authorization: Bearer LUW_API_TOKEN"
```

**Response Example**

```json
{
  "status": true,
  "materials": [
    {
      "id": 1,
      "prompt_type": "Material",
      "title": "Marble",
      "extra": "White marble with grey veins",
      "image": "https://cdn.luw.ai/materials/marble.jpg"
    }
  ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://luw-ai.gitbook.io/api/luw.ai-api-documentation/introduction/authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
