> For the complete documentation index, see [llms.txt](https://docs.layerlens.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.layerlens.ai/11.-admin/rotate-api-key.md).

# Rotate API key

API keys rotate with a 24-hour grace period.

## Steps

1. **Settings → API keys → Rotate** on the key in question.
2. Stratix returns a new key value (one-time-display). Copy it.
3. Update the new value in your secret store / env vars / CI secrets.
4. Old key continues to work for 24 hours.
5. After rollout, the old key auto-expires. No action needed.

## When to rotate

* Compromise suspected
* Quarterly hygiene
* Departing team member had access
* Switching CI runners

## After rotation

* Verify the new key works in a non-production runner first
* Watch the audit log for unexpected usage on the old key during the grace period

## See also

* [API keys reference](https://github.com/LayerLens/gitbook-full/blob/main/13-reference/api/api-keys.md)
* [Authentication](https://github.com/LayerLens/gitbook-full/blob/main/13-reference/sdk-python/authentication.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.layerlens.ai/11.-admin/rotate-api-key.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
