> ## 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.

# Custom provider base URL causes chat prompt errors

export const plans_0 = "Any"

export const deployments_0 = "Any"

export const data_plane_version_0 = undefined

export const use_case_0 = "Use case - Configuring a custom AI provider when the prompt chat fails due to a malformed upstream URL"

<Note>
  **Applies to:**

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

## Summary

**Issue:** Chat with a prompt in a Conversation project fails when the AI provider's base URL includes the `/chat/completions` path suffix, resulting in a duplicated upstream path like `/v1/chat/completions/chat/completions` that OpenAI rejects.

**Cause:** Braintrust automatically appends `/chat/completions` when constructing the upstream request URL, so including it in the base URL causes the path to be doubled.

**Resolution:** Remove `/chat/completions` from the provider's base URL and retry.

## Resolution steps

#### Step 1: Open the provider settings

Navigate to **Organization Settings** → **AI Providers** and select the provider backing the model (e.g., `GPT-5.2 Chat Provider`).

#### Step 2: Fix the base URL

Update the **API base URL** field so it ends before `/chat/completions`.

| Incorrect                                    | Correct                     |
| -------------------------------------------- | --------------------------- |
| `https://api.openai.com/v1/chat/completions` | `https://api.openai.com/v1` |

For standard OpenAI providers, you can also leave the base URL field blank to use the default.

#### Step 3: Save and retry

Save the provider configuration, reload the prompt page, and send the same chat message.
