# Generate a bearer token | Orion Data API v1.1

> For the complete documentation index, see [llms.txt](https://docs.oriondata.io/llms.txt)

Deprecated

`GET /token`

**Example request (javascript, fetch)**

```js
const url = 'https://api.oriondata.io/api/token?apiKey=example';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Example request (shell, curl)**

```sh
curl --request GET \
  --url 'https://api.oriondata.io/api/token?apiKey=example'
```

- Productionapi.oriondata.io/api/token

Exchanges an API key for a JWT bearer token. The token is valid for 7 days, although generating a fresh token each session is recommended. The bearer token returned by this endpoint must be supplied in the `Authorization` header of every other request.

## Parameters

### Query Parameters

**apiKey**

required

string

The API key generated from the Account Settings page of the Orion Data application.

## Responses

### 200

A JSON object containing the bearer token.

application/json

object

**token**

The JWT bearer token. Supply this string in the Authorization header as `Bearer {token}`.

string

#### Example

```json
{
  "token": "your_generated_token_here"
}
```

### 400

The server could not understand the request.

### 404

The resource could not be found.

### 429

Rate limit exceeded.
