> For the complete documentation index, see [llms.txt](https://docs.avis.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avis.xyz/guide/get-started/avis-api-key.md).

# How to get API Key

An API key is the credential your code uses to authenticate requests to the Avis API and access its 300+ models. You create keys, set spending limits on them, and revoke them from your profile — each key is billed against your Avis credit balance.

**Warning:** Treat an API key like a password. It grants spending access to your account balance up to the limits you set. Never commit it to a public repository, share it in screenshots, or paste it into client-side code.

***

## Creating an API Key

**Step 1:** Go to [avis.xyz/profile/api-keys](https://www.avis.xyz/profile/api-keys), or open [your profile](https://www.avis.xyz/profile/) and choose **API Keys**.

**Step 2:** Click **Create New API Keys**.

<figure><img src="/files/OXPZLDYpM5UNED7tVrAB" alt=""><figcaption></figcaption></figure>

**Step 3:** Set the key's parameters:

* **Name:** a label to help you recognize the key later (under 50 characters).
* **Spend limit daily:** the maximum this key can spend in a single day.
* **Spend limit weekly:** the maximum for a rolling week.
* **Spend limit monthly:** the maximum for a rolling month.
* **Spend limit total:** a lifetime cap for this key.

<figure><img src="/files/PsvANT04SdBrH9v4brZh" alt=""><figcaption></figcaption></figure>

**Step 4:** When you're done, click **Confirm**.

**Step 5:** Copy your API key, then click **Done**.

<figure><img src="/files/GpOlRvFmCxBHA3w6FE36" alt=""><figcaption></figcaption></figure>

**Protect your key**

* Treat it like a password. Never commit it to a repo, paste it in client-side code, or share it in screenshots or chats.
* Store it in a secrets manager or environment variable, not in plaintext.
* Set a spend limit on every key so a leak can't run up unbounded charges.
* Use a separate key per app or environment. That caps the blast radius, if one leaks, you revoke just that key without breaking your other integrations.

**If a key leaks**, revoke it immediately, then issue a replacement and rotate it into your affected apps. Don't wait to confirm misuse, a revoked key can't be abused, and the cost of rotating is far lower than the cost of a compromised key left live.

***

## Managing Your API Keys

After a key is created, you can manage it at any time from the same **API Keys** page:

* **Copy** the API key again — *(only where the platform still exposes it; the full secret is typically shown once at creation).*
* **Edit** the key — update its name or spend limits.
* **Delete** the key — revoke it permanently.

<figure><img src="/files/zsSD6wwFrAevHGWhEC3C" alt=""><figcaption></figcaption></figure>

**Note:** Deleting a key takes effect immediately and cannot be undone. Any application still using that key will stop working, so update your app with a new key before deleting the old one.

***

## What's Next

* Make sure you have credits to spend, see [How to top up your balance](/guide/get-started/avis-topup.md).
* New to Avis? Start with [How to login/ sign up](/guide/get-started/avis-login-signup.md).

***

## FAQ

### What is an Avis API key used for?

It authenticates your requests to the Avis API, giving your application programmatic access to Avis's 300+ models for video, image, audio, and text generation. Every request made with the key is billed to your credit balance.

### Can I see my key again after creating it?

The full key is shown once at creation, so copy and store it securely at that point. If you lose it, create a new key and delete the old one.

### How do spend limits work?

Each limit caps how much a single key can spend over that period — daily, weekly, monthly, or in total. They're a safeguard against runaway usage or a leaked key; requests are declined once a limit is reached.

### What happens when I delete a key?

It's revoked immediately and permanently. Any app using it will stop working, so roll in a replacement key first.


---

# 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.avis.xyz/guide/get-started/avis-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.
