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

# HTTP 421 errors with self-hosted data planes

export const plans_0 = "Enterprise"

export const deployments_0 = "Self-hosted"

export const data_plane_version_0 = undefined

export const use_case_0 = "Use case - API requests with custom data plane configurations"

<Note>
  **Applies to:**

  * Plan - {plans_0}
  * Deployment - {deployments_0}
  * {data_plane_version_0}
  * {use_case_0}
</Note>

Summary

**Issue:** API requests fail with `HTTP 421 Client Error: Misdirected Request` when making requests to `https://api.braintrust.dev` in self-hosted or enterprise deployments. **Cause:** Your organization uses a custom data plane URL, and the default API endpoint returns 421 when it detects this configuration. **Resolution:** Use your organization's custom data plane API URL instead of the default endpoint.

## Resolution Steps

### Step 1: Find your custom API URL

Navigate to **Settings** → **Organization** → **Data Plane** → **API URL** and copy the custom API URL displayed.

### Step 2: Update your API requests

Replace `https://api.braintrust.dev` with your custom API URL in all requests.

```text theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
response = requests.post(
    "https://your-custom-url.braintrust.dev/btql",  # Use your custom URL
    headers={
        "Authorization": f"Bearer {BRAINTRUST_API_KEY}",
        "Content-Type": "application/json"
    },
    json={"query": "..."}
)

```

### Step 3: Verify the request succeeds

Test your API request to confirm it returns a successful response instead of the 421 error.
