> ## Documentation Index
> Fetch the complete documentation index at: https://docs.1eye.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Authenticate requests to the 1eye API using a workspace API key.

The 1eye API uses **Bearer API-key authentication**.

Every API request must include your API key in the `Authorization` header.

```text theme={null}
Authorization: Bearer 1eye_live_xxxxxxxxx
```

## Example request

```text theme={null}
curl "https://api.1eye.ai/v1/buyers" \
  -H "Authorization: Bearer 1eye_live_xxxxxxxxx"
```

API keys are scoped to a single 1eye workspace. The API key automatically determines which workspace the request belongs to, so a workspace ID does not need to be included in the API URL.

## API key format

Production API keys begin with:

```text theme={null}
1eye_live_
```

Example:

```text theme={null}
1eye_live_Lk38fJ2xxxxxxxx
```

## Using your API key

API keys must:

* Be passed in the `Authorization` header
* Use the `Bearer` authentication scheme
* Only be transmitted over HTTPS

API keys must never:

* Be passed as query parameters
* Be included in URLs
* Be written to application logs
* Be written to API logs
* Be included in error messages

## Authentication errors

If an API key is missing, invalid, or revoked, the API returns:

```text theme={null}
401 Unauthorized
```

Example response:

```text theme={null}
{
  "error": {
    "code": "authentication_error",
    "message": "Invalid or missing API key.",
    "request_id": "req_359051753366339585"
  }
}
```

## Workspace access

An API key can only access resources that belong to its associated workspace.

If a requested resource does not exist or belongs to another workspace, the API returns:

```text theme={null}
404 Not Found
```

The API does not reveal whether a resource exists in another workspace.

## Next step

Create and manage your API keys from the **API Keys** section.
