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

# Custom provider base URL causes chat prompt errors

> [!NOTE]
>
> **Applies to:**
>
> * Plan - Any
> * Deployment - Any
> *
> * Use case - Configuring a custom AI provider when the prompt chat fails due to a malformed upstream URL

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

Go to ** Settings** > [** Models**](https://www.braintrust.dev/app/~/configuration/models/organization) and open the provider backing the model (for example, `GPT-5.2 Chat Provider`). Select **Setup** and expand **More settings** if it is collapsed.

#### Step 2: Fix the base URL

Under **Request configuration**, 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

Click **Update**, reload the prompt page, and send the same chat message.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.