If you’re building an agent, we recommend using sessions instead. Sessions handle authentication automatically via in-chat authentication or manual authentication.
Passing credentials directly
PasscustomAuthParams in the tools.execute() call to inject your own token as a header or query parameter.
- Python
- TypeScript
- API
Parameter options
Each entry in theparameters array accepts:
You can also set
base_url (Python) / baseURL (TypeScript) to override the default API base URL for the toolkit.
Using a beforeExecute modifier
For more control — such as conditionally injecting credentials based on toolkit or tool — use abeforeExecute modifier.
This is a Before Execute Modifier!
Before Execute Modifiers are a way to modify the parameters of a tool before it is executed. In this case, they are useful for adding custom authentication headers or parameters to a tool.
- Python
- TypeScript