#Copilot cloud public api key

1 messages · Page 1 of 1 (latest)

steel basin
#

Is copilot cloud public api key mandatory? Or can I use my own llm api key?

wanton nacelleBOT
#

This solution has been AI generated

The Copilot Cloud public API key is not mandatory. You can self-host CopilotKit and use your own LLM provider API key via service adapters. The public key is only needed if you opt into Copilot Cloud features.

Options

  • Use Copilot Cloud (requires publicApiKey): Enables cloud features like observability and telemetry by setting publicApiKey in CopilotKit props.
  • Self-host and use your own LLM key (no publicApiKey required): Point runtimeUrl to your backend and configure a service adapter (e.g., OpenAI) with your own API key.

Example: Self-host with your own LLM key

// Frontend
import { CopilotKit } from "@copilotkit/react-core";

<CopilotKit
  runtimeUrl="/api/copilotkit" // your self-hosted runtime
>
  {/* your app */}
</CopilotKit>
// Backend runtime (e.g., Next.js /api/copilotkit)
import { CopilotRuntime, OpenAIAdapter } from "@copilotkit/runtime";

const copilotKit = new CopilotRuntime();
const serviceAdapter = new OpenAIAdapter({
  apiKey: process.env.OPENAI_API_KEY,
});
copilotKit.use(serviceAdapter);

Key points

  • publicApiKey is optional and only used for Copilot Cloud.
  • For self-hosting, use runtimeUrl and a service adapter with your own provider key.

Docs/refs:

Was this helpful?

If this solution worked for you, please click on the appropriate option below to help us improve:

wanton nacelleBOT
#

Hey there! Did the response address your question?

steel basin
#

Yes @tight matrix, but as im new its all german for me. Is there a working example anywhere I can refer to for an end to end app using local backend and local llm call?

wanton nacelleBOT