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

# API Keys

> Create and manage API credentials

API Keys are the foundation of your SpatialReal integration. They allow you to authenticate your applications and securely access SpatialReal services. In this guide, you'll learn how to create API Keys in [SpatialReal Studio](https://app.spatialreal.ai) and best practices for managing them.

## Creating an API Key

<Steps>
  <Step title="Open API Keys page">
    Go to [https://app.spatialreal.ai/apps](https://app.spatialreal.ai/apps).
  </Step>

  <Step title="Click Create API Key">
    On the API key page, click **Create API Key**.

    <Frame>
      <img src="https://mintcdn.com/spatialwalk-6179c111/qnztiu5AG8MQNKy5/images/apikeystep1.png?fit=max&auto=format&n=qnztiu5AG8MQNKy5&q=85&s=23c01df67cbdccc562cfcf2cf506520c" alt="API Keys page" width="698" height="224" data-path="images/apikeystep1.png" />
    </Frame>
  </Step>

  <Step title="Enter application name">
    Type your **Application Name** and click **Create**.

    <Frame>
      <img src="https://mintcdn.com/spatialwalk-6179c111/qnztiu5AG8MQNKy5/images/apikeystep2.png?fit=max&auto=format&n=qnztiu5AG8MQNKy5&q=85&s=db2b1604f0a58532853ad5f55593d6dd" alt="Click Create API Key" width="958" height="502" data-path="images/apikeystep2.png" />
    </Frame>
  </Step>

  <Step title="Copy App ID and API Key">
    In the popup, copy both **App ID** and **API Key**.

    <Frame>
      <img src="https://mintcdn.com/spatialwalk-6179c111/qnztiu5AG8MQNKy5/images/apikeystep3.png?fit=max&auto=format&n=qnztiu5AG8MQNKy5&q=85&s=4d6716892df1a0109d01de140d52e53a" alt="Create app and view popup" width="1388" height="1060" data-path="images/apikeystep3.png" />
    </Frame>
  </Step>
</Steps>

***

## Manage your API Key

Your API Key is used to authenticate server-side requests to SpatialReal services.

<Warning>
  **Important:** Keep your API Key secure and never expose it in client-side code or commit it to version control. Treat it like a password to prevent unauthorized access to your SpatialReal account.
</Warning>

**Best Practices:**

* Store your API Key in environment variables or a secrets manager
* Never expose your API Key in client-side code
* Never commit your API Key to version control

***

## Temporary Session Token

For quick testing and development, you can generate a **Temporary Session Token** directly in [SpatialReal Studio](https://app.spatialreal.ai).

<Note>
  Temporary Session Tokens are valid for **24 hours** only. They are intended for testing purposes and should not be used in production.
</Note>

<Steps>
  <Step title="Open Your Application">
    Navigate to [API keys page in SpatialReal Studio](https://app.spatialreal.ai/apps), then click the details button of your application.

    <Frame>
      <img src="https://mintcdn.com/spatialwalk-6179c111/qnztiu5AG8MQNKy5/images/tokenstep1.png?fit=max&auto=format&n=qnztiu5AG8MQNKy5&q=85&s=996946de1aaaa4179b05d00b3a274882" alt="Token Step 1" width="2994" height="262" data-path="images/tokenstep1.png" />
    </Frame>
  </Step>

  <Step title="Generate Token">
    Click **Generate Temporary Token** to create a new temporary session token.

    <Frame>
      <img src="https://mintcdn.com/spatialwalk-6179c111/qnztiu5AG8MQNKy5/images/tokenstep2.png?fit=max&auto=format&n=qnztiu5AG8MQNKy5&q=85&s=58b0facb478771dc2e037d12375af4eb" alt="Token Step 2" width="2996" height="580" data-path="images/tokenstep2.png" />
    </Frame>
  </Step>

  <Step title="Use for Testing">
    Use this token in your client SDK to test avatar rendering without setting up server-side authentication.
  </Step>
</Steps>

***

## Production Authentication

In production, you should generate session tokens from your backend server using the API Key. See the [Authentication Guide](/server/auth) for implementation details.

<Card title="Authentication Guide" icon="lock" href="/server/auth">
  Learn how to implement secure server-side authentication
</Card>
