#Agent component
3 messages · Page 1 of 1 (latest)
Hi @opaque rivet. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Based on the available knowledge sources, there is no indication that you can provide an API key directly in the constructor of the Agent component to enable a "bring your own key" (BYOK) pattern.
The Agent component's constructor is designed to accept configuration options such as the language model, instructions, tools, and other agent-specific settings, but there is no mention of an API key parameter for BYOK in the constructor or configuration options. Instead, API keys are used for authenticating access to backend APIs, such as when using the Playground or exposing APIs to external clients. In those cases, API keys are generated and validated separately, not passed to the Agent constructor itself. For example, the Playground setup uses API keys for secure backend communication, but these are managed outside the Agent instance and are not part of its instantiation or configuration options Agents Playground.
If you want to support user-supplied API keys (BYOK), you would need to handle this logic separately—such as storing and retrieving user keys and passing them to the relevant LLM provider or service when making requests, rather than configuring them directly in the Agent constructor.
If you need more advanced or custom API key handling, you may need to implement this at the application logic level, not within the Agent component's constructor or configuration.