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

# Custom Domain

<Warning>
  The following code is for users using Encord with the US domain (`https://api.us.encord.com`) or their own private VPC (Virtual Private Cloud).
</Warning>

## STEP 1: Set the `ENCORD_DOMAIN` Environment variable

This will be the domain to the Encord API, not the front-end app.

If running locally:

```shell theme={"dark"}
export ENCORD_DOMAIN=https://api.us.encord.com
```

If running in a Python project:

```python theme={"dark"}
import os

os.environ["ENCORD_DOMAIN"] = "https://api.us.encord.com"
```

## STEP 2: Set the `ENCORD_SSH_KEY` or `ENCORD_SSH_KEY_FILE` Environment variables

If running locally:

<CodeGroup>
  ```shell Key theme={"dark"}
  export ENCORD_SSH_KEY="<your key>"
  ```

  ```shell Key Path theme={"dark"}
  export ENCORD_SSH_KEY_FILE="path/to/your/key"
  ```
</CodeGroup>

If deploying with a GCP cloud function, create a GCP secret & pass in the Key

<CodeGroup>
  ```python Key theme={"dark"}
  import os

  os.environ["ENCORD_SSH_KEY"] = "<your key>"
  ```

  ```python Key Path theme={"dark"}
  os.environ["ENCORD_SSH_KEY_FILE"] = "path/to/your/file"
  ```
</CodeGroup>

## STEP 3: Instantiate the Client from the Agent

<Warning>
  This step is only required if your agent uses the Encord Client.
</Warning>

Since Encord is a separate package than Encord-Agents, when leveraging an Encord Client, you also need to use the client connected to the agent.

For tasks that need the Encord client for every operation, we recommend:

```python theme={"dark"}
@app.post("/my-agent")
def my_agent(user_client: Annotated[EncordUserClient, Depends(dep_user_client)]):
    # use agent to get project, dataset, etc
```

If you only need the client once to do batch processing or filtering, you can fetch the existing client from the agents library:

```python theme={"dark"}
from encord_agents.core.utils import get_user_client

encord_user_client = get_user_client()
```
