Problem
The TokenAuthProvider.get_client() creates a FoundryClient without preview=True. Many v2 API endpoints (especially orchestration/builds) require preview mode and fail with ApiFeaturePreviewUsageOnly error.
Reproduction
pltr orchestration builds search
# Fails with: ApiFeaturePreviewUsageOnly
Root Cause
In src/pltr/auth/token.py:
return FoundryClient(auth=auth, hostname=self.host)
Should be:
return FoundryClient(auth=auth, hostname=self.host, preview=True)
The ?preview=true query parameter also needs to be added to direct API calls. The SDK passes this automatically when the client is created with preview=True.
Workaround
Call the API directly with ?preview=true query parameter.
Files
src/pltr/auth/token.py — get_client()
src/pltr/auth/oauth.py — likely same issue