# How to get an API token

Source: https://docs.quake.ai/docs/tools/api-tokens
Markdown: https://docs.quake.ai/docs/tools/api-tokens.md

---

# How to get an API token

Generate a project-scoped API token from the Quake AI console to authenticate direct HTTP requests against OpenStack service endpoints. Tokens are issued by the Identity service (Keystone), scoped to your current project, and valid for 24 hours.

Use tokens when you need quick, ad-hoc API access, for example testing an endpoint with `curl` or debugging a workflow. For long-lived programmatic access, use [application credentials](/docs/tools/generate-app-credentials) instead.

<PrerequisiteBlock methods={["console", "cli"]}>

- A Quake AI project with at least one active service

</PrerequisiteBlock>

## Get a token from the console

<MethodTabs>
<Method label="Console">

1. Select **API** > **API Endpoints** in the sidebar.
2. Select **Get Token** in the upper-right area of the endpoints table.
3. The console opens the **Get Token** dialog and displays your scoped token. An info banner reminds you to save the token and shows a live countdown of the time left before it expires. Select the copy icon next to the token to copy it to your clipboard.
4. Below the token, the dialog shows the project ID the token is scoped to and the username it was issued for, each with its own copy control.
5. The dialog footer has **Cancel** and **OK** buttons. Select **OK** to close the dialog.

<Figure caption="API Endpoints page with the Get Token button">
  <img src="https://object.us-east-1.rumble.cloud/77e78aa9c0e04ed0b9d1a3f0626a8c4d:developer-platform-images/images/console/api/api-endpoints-acccc48d.png" alt="API Endpoints page showing all 12 service endpoint base URLs and the Get Token button in the upper right" />
</Figure>

The token is scoped to the project you are currently viewing. If you need a different project scope, switch projects in the sidebar before generating a token.

</Method>
<Method label="CLI">

If you have [application credentials](/docs/tools/generate-app-credentials) configured in your `clouds.yaml`, request a token with the OpenStack CLI:

```bash
openstack token issue
```

The output includes the token value, project ID, expiration time, and user ID.

To print only the token value for use in scripts:

```bash
OS_TOKEN=$(openstack token issue -f value -c id)
echo "$OS_TOKEN"
```

</Method>
</MethodTabs>

## Use the token with curl

Once you have a token, pass it in the `X-Auth-Token` header to authenticate API requests. For example, to list compute instances:

```bash
curl -s -H "X-Auth-Token: $OS_TOKEN" \
  https://compute.us-east-1.rumble.cloud/v2.1/servers \  # replace region as needed
  | python3 -m json.tool
```

To check your token details and expiration:

```bash
curl -s -H "X-Auth-Token: $OS_TOKEN" \
  https://keystone.rumble.cloud/v3/auth/tokens \
  -H "X-Subject-Token: $OS_TOKEN" \
  | python3 -m json.tool
```



Tokens expire after 24 hours. If you receive a `401 Unauthorized` response, generate a new token. For automated workflows, use [application credentials](/docs/tools/generate-app-credentials); they handle token renewal automatically.



## Token scope and lifetime

| Property | Value |
|----------|-------|
| Issuer | Identity service (Keystone) at <code>{AUTH_URL}</code> |
| Scope | Project-scoped: grants access to resources in a single project |
| Lifetime | 24 hours from issuance |
| Format | Fernet token (opaque string) |

Tokens carry the same permissions as your user account within the scoped project. Treat them as credentials: do not log them, commit them to version control, or share them.

## See also

- [API access console reference](/docs/tools/api-access-console): overview of the API section in the console
- [Service Endpoints](/docs/tools/service-endpoints): all 12 service base URLs
- [API Endpoints console](/docs/tools/api-endpoints): console reference for the endpoints view
- [Generate application credentials](/docs/tools/generate-app-credentials): long-lived credentials for automation
- [API versions and microversions](/docs/tools/api-versions): version negotiation for OpenStack APIs
