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

<CopilotKit 
  url="https://your.copilotkit.api">
  <YourApp/>
</CopilotKit>

This component provides the Copilot context to its children. It can be configured either with a chat API endpoint or a CopilotApiConfig.

The backend can use OpenAI, or you can bring your own LLM. For examples of the backend api implementation, see examples/next-openai or the backend docs.

Example usage

<CopilotKit url="https://your.copilotkit.api">
  <App />
</CopilotKit>

Props

url
string
required

The endpoint for the chat API.

headers
Record<string, string>
default: "{}"

Additional headers to be sent with the request.

For example:

{
  'Authorization': 'Bearer your_token_here'
}
body
Record<string, string>
default: "{}"

Additional body params to be sent with the request.

For example:

{
  'message': 'Hello, world!'
}
children
ReactNode

The children to be rendered within the CopilotKit.