#Copilot cloud public api key
1 messages · Page 1 of 1 (latest)
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
publicApiKeyinCopilotKitprops. - Self-host and use your own LLM key (no publicApiKey required): Point
runtimeUrlto 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
publicApiKeyis optional and only used for Copilot Cloud.- For self-hosting, use
runtimeUrland a service adapter with your own provider key.
Docs/refs:
- Self-Hosting Guide: https://docs.copilotkit.ai/guides/backend-actions/self-hosting
- Service Adapters: https://docs.copilotkit.ai/reference/classes/llm-adapters/OpenAIAdapter
- Props (publicApiKey optional): https://github.com/CopilotKit/CopilotKit/blob/main/CopilotKit/packages/react-core/src/components/copilot-provider/copilotkit-props.tsx
Was this helpful?
If this solution worked for you, please click on the appropriate option below to help us improve:
Hey there! Did the response address your question?
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?
Check out this demo and see if it helps: https://github.com/CopilotKit/example-todos-app