Enabling Code Chat Engine v2
const builder = new ContentBox({
// ...
chatEngine: 'v2', // enable Code Chat engine (v2)
chatAttachments: true, // let users attach images, PDFs and documents
sendCommandUrl: '/openrouter', // your AI endpoint, can be changed to use OpenAI. See docs/README.md
codeModels: [ // models offered in Chat Settings
{ id: '~anthropic/claude-opus-latest', label: 'Claude Opus (Latest)' },
{ id: '~anthropic/claude-sonnet-latest', label: 'Claude Sonnet (Latest)' },
{ id: '~google/gemini-pro-latest', label: 'Gemini Pro (Latest)' },
{ id: '~openai/gpt-latest', label: 'GPT (Latest)' },
],
defaultChatSettings: {
codeModel: '~anthropic/claude-opus-latest',
imageModel: 'google/gemini-3-pro-image',
imageSize: '',
},
});
Code Chat needs a server-side endpoint to communicate with an AI provider. Examples are provided in Node.js, PHP, and Next.js, but you can implement the endpoint in any language.
If you already have an endpoint from Code Chat v1, you need to update
the existing endpoint (sendCommandUrl) to enable Code Chat v2.