TL;DR: Keep endpoint and deployment name in environment config and fail fast at startup if either is unset, so the error surfaces before the first call. When a Foundry sample or agent fails to connect, diff your config against the project dashboard character by character. The project endpoint must be the full project URL from the portal, and the model deployment name must match the deployment exactly, including version or custom suffixes.

When a Foundry sample or agent fails to connect, diff your config against the project dashboard character by character. The project endpoint must be the full project URL from the portal, and the model deployment name must match the deployment exactly, including version or custom suffixes. A common trap: the dashboard shows the model name (e.g. gpt-4o) but the deployment was named something else (e.g. gpt-4o-prod); using the model name gives a 404 DeploymentNotFound. Keep endpoint and deployment name in environment config and fail fast at startup if either is unset, so the error surfaces before the first call.

## When to use
You hit exactly this: Foundry DeploymentNotFound: the deployment name must match the dashboard exactly in Foundry DeploymentNotFound.

## When not to use
A different error, or the same symptom in a different tool. This page only covers the failure above.

## Compatibility
Foundry DeploymentNotFound.

## Edge cases
- The project endpoint must be the full project URL from the portal, and the model deployment name must match the deployment exactly, including version or custom suffixes.
- A common trap: the dashboard shows the model name (e.g. gpt-4o) but the deployment was named something else (e.g. gpt-4o-prod); using the model name gives a 404 DeploymentNotFound.