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

# Generating an API Key

> Create a Venice API key from the dashboard, store the bearer token securely, and verify it works with a first authenticated chat completions request.

Venice API requests are authenticated with Bearer API keys. This guide shows how to create a key from the Venice dashboard, store it safely, and verify that it works.

<Note>
  If you are building an autonomous agent that needs to mint its own key with a wallet, use the [Autonomous Agent API Key Creation](/guides/getting-started/generating-api-key-agent) guide instead.
</Note>

## Before you start

* Sign in to your Venice account.
* Make sure the account has a spendable balance before calling paid endpoints. You can create a key before funding the account, but model requests will not succeed until the account can consume DIEM, bundled credits, or USD.

<Steps>
  <Step title="Open API settings">
    Visit [https://venice.ai/settings/api](https://venice.ai/settings/api). You can also open this page from the Venice app by selecting **API** in your settings.

    The API settings dashboard shows your balances, API tier, usage, and existing API keys.
  </Step>

  <Step title="Start a new key">
    Select **Generate New API Key**, then configure the key:

    * **Description:** Use a short name that identifies the app, environment, or integration that will use this key.
    * **API Key Type:** Use **Inference Only** for normal model requests. Use **Admin** only when the key must manage API keys programmatically.
    * **Expires at:** Optionally set an expiration date. If you leave this blank, the key does not expire automatically.
    * **Epoch Consumption Limits:** Optionally cap how much DIEM or USD this key can spend during a 24-hour epoch. If you leave this blank, the key can use the account's available balance subject to your account limits.
  </Step>

  <Step title="Generate and copy the key">
    Click **Generate**. Venice will show the full API key one time.

    <Warning>
      Copy the key immediately and store it in a secure location. After you close the dialog, Venice only shows identifying metadata such as the key description and last characters. If you lose the secret value, delete the key and create a new one.
    </Warning>

    Add the key to your local environment or secret manager:

    ```bash theme={"system"}
    export VENICE_API_KEY="your-api-key-here"
    ```
  </Step>

  <Step title="Verify the key">
    Make a low-risk request to confirm that authentication is working:

    ```bash theme={"system"}
    curl --request GET \
      --url https://api.venice.ai/api/v1/models \
      --header "Authorization: Bearer $VENICE_API_KEY"
    ```

    A successful response returns the available models. If you receive an authentication error, confirm that the key was copied completely and that the `Authorization` header is formatted as `Bearer <api-key>`.
  </Step>
</Steps>

## Best practices

* Create separate keys for development, staging, and production.
* Prefer **Inference Only** keys for applications that only call model endpoints.
* Keep **Admin** keys rare, tightly scoped, and stored only in trusted server-side environments.
* Never commit API keys to source control or expose them in client-side code.
* Set expiration dates and consumption limits for keys used in temporary, shared, or higher-risk environments.
* Delete unused keys and rotate any key that may have been exposed.

## Programmatic key management

Admin keys can manage API keys through the API reference endpoints:

<CardGroup cols={2}>
  <Card title="Create API Key" icon="plus" href="/api-reference/endpoint/api_keys/create">
    Create a new dashboard-style API key from an existing admin key.
  </Card>

  <Card title="List API Keys" icon="list" href="/api-reference/endpoint/api_keys/list">
    View active keys and their metadata.
  </Card>

  <Card title="Update API Key" icon="pen-to-square" href="/api-reference/endpoint/api_keys/update">
    Update a key description, expiration date, or consumption limits.
  </Card>

  <Card title="Delete API Key" icon="trash" href="/api-reference/endpoint/api_keys/delete">
    Revoke a key that is no longer needed.
  </Card>
</CardGroup>
