diff --git a/src/app/api/copilotkit/route.ts b/src/app/api/copilotkit/route.ts index 14f8974..0da1339 100644 --- a/src/app/api/copilotkit/route.ts +++ b/src/app/api/copilotkit/route.ts @@ -16,7 +16,10 @@ const serviceAdapter = new ExperimentalEmptyAdapter(); const runtime = new CopilotRuntime({ agents: { // Our FastAPI endpoint URL - strands_agent: new HttpAgent({ url: process.env.STRANDS_AGENT_URL || "http://localhost:8000" }), + strands_agent: new HttpAgent({ + url: process.env.STRANDS_AGENT_URL || "http://localhost:8000", + ...(process.env.STRANDS_AGENT_BEARER_TOKEN && { headers: { Authorization: `Bearer ${process.env.STRANDS_AGENT_BEARER_TOKEN}` } }) + }), }, });