JuliusBrussee/caveman · error

azure legacy inference path

Error message

azure legacy inference path %q is not supported

What it means

The adapter validates that the request path matches either the Foundry v1 inference route or the legacy chat-completions deployment route. Any other path shape is rejected. This error means the path was neither, so the adapter cannot resolve an upstream Azure endpoint for it.

Solutions

  1. Use only the supported paths: /azure/openai/v1/chat/completions, /azure/openai/v1/responses, or /azure/openai/deployments/{deployment}/chat/completions.
  2. Check the deployment name: it must be 1-128 chars of [A-Za-z0-9._-]; rename or re-encode it.
  3. If the endpoint is another Azure API surface, route it directly or through a provider/adapter that supports it.

Example fix

// before
POST /azure/openai/deployments/my-deployment/embeddings
// after
POST /azure/openai/deployments/my-deployment/chat/completions
Defensive patterns

Strategy: validation

Validate before calling

func pathSupported(rawURL string) bool {
	u, _ := url.Parse(rawURL)
	p := strings.TrimPrefix(u.Path, "/azure")
	if p == "/openai/v1/chat/completions" || p == "/openai/v1/responses" {
		return true
	}
	parts := strings.Split(strings.Trim(p, "/"), "/")
	return len(parts) == 5 && parts[0] == "openai" && parts[1] == "deployments" &&
		parts[3] == "chat" && parts[4] == "completions"
}

Prevention

When it happens

Trigger: A request whose path (after the /azure prefix) is not /openai/v1/chat/completions, /openai/v1/responses, and not /openai/deployments/{deployment}/chat/completions — e.g. /openai/deployments/my-dep/embeddings or /openai/deployments/{dep}/chat/completions with an invalid deployment name containing characters outside [A-Za-z0-9._-] or longer than 128 chars.

Common situations: Pointing other OpenAI API surfaces (embeddings, images, completions) at the proxy; a deployment name with a slash or url-encoded characters that fails the strict legacy-route matcher; mistyped paths.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20). Data as JSON: /api/errors/36fe5742ced5470c. Report an issue: GitHub.

Appendix: source

Thrown at proxy/providers/azureopenai/azure_routing.go:50

	if err := validateAzureRequest(req.URL); err != nil {
		return nil, err
	}
	return a.Base.ResolveUpstreamURL(ctx, req, route)
}

func validateAzureRequest(u *url.URL) error {
	if foundryV1InferenceRoute(u.Path) {
		versions := u.Query()["api-version"]
		if len(versions) > 1 {
			return fmt.Errorf("azure request has duplicate api-version values")
		}
		if len(versions) == 1 && versions[0] != "v1" && versions[0] != "preview" {
			return fmt.Errorf("azure Foundry api-version %q is not supported", versions[0])
		}
		return nil
	}
	if !legacyChatCompletionsRoute(u.Path) {
		return fmt.Errorf("azure legacy inference path %q is not supported", u.Path)
	}
	versions := u.Query()["api-version"]
	if len(versions) > 1 {
		return fmt.Errorf("azure request has duplicate api-version values")
	}
	version := ""
	if len(versions) == 1 {
		version = versions[0]
	}
	if version == "" {
		return fmt.Errorf("azure request missing api-version")
	}
	if !apiVersionAllowed(version) {
		return fmt.Errorf("azure api-version %q is not on the allowlist", version)
	}
	return nil
}

View on GitHub (pinned to 3ee70a1026)