---
title: "Quickstart: Copilot Runtime"
description: "How to setup the CopilotRuntime endpoints"
---
## Option 1: Use Copilot Cloud
### Get a free hosted Copilot Runtime via Copilot Cloud:
Initialize CopilotKit using your public API key:
```
```
## Option 2: Host your own Copilot Runtime
### Install CopilotKit Backend packages
Install the CopilotKit backend packages:
```bash npm
npm i @copilotkit/backend
```
```bash yarn
yarn add @copilotkit/backend
```
```bash pnpm
pnpm add @copilotkit/backend
```
#### Manually specified endpoint: Next.js edge function (typescript)
Remember to add any required environment variables. E.g. to use OpenAI:
```env .env.local
OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```
#### Manually specified endpoint: Next.js pages router
#### Manually specified endpoint: Node.js (typescript)
Remember to add any required environment variables. E.g. to use OpenAI:
#### Firebase (GCP) Cloud Function (typescript)
See this repo for a full example: https://github.com/CopilotKit/copilotkit-firebase-demo