Failure Index / Auth & permissions · critical · LangChain · OpenAI Agents SDK
Stripe tool fails: authentication error / invalid API key
Stripe rejected the agent's request — invalid or expired API key, or a key from the wrong mode (test vs live). A very common variant: 'No such customer' because the customer exists in live mode but the agent holds a test-mode key.
The error
stripe invalid api key agent
AuthenticationError stripe langchain tool
stripe no such customer test mode live modeRoot cause
Stripe keys are mode-scoped: test keys only see test data. Agents configured with a test key but fed live customer IDs (or vice versa) fail with what looks like an auth or missing-resource error. Rotated or restricted keys are the other frequent cause.
The fix
Confirm the key's mode matches the data the agent works with (sk_test_ vs sk_live_). Check the key still exists in the Stripe dashboard and has the required capabilities. If using restricted keys, verify the specific resource permission.
Preventing it next time
Keep test and live configurations fully separated per environment, and never let an agent decide which mode to use at runtime.
pip install vorlo-trace · npm install vorlo-trace. Start free