Migration Guide

This guide contains all the information you need to migrate between different versions of the ZeebeeAI Chat SDK. We strive to maintain backward compatibility whenever possible, but sometimes breaking changes are necessary to improve the platform. This guide will help you navigate these changes smoothly.

Current Version: v2.2.0 (Released: April 2025)

Migrating from v1.x to v2.x v1.xv2.x

Version 2.0 includes several significant changes to the API structure and functionality. This is a major version update with breaking changes.

Key Changes

Authentication Changes

v1.x v2.x
API keys in query parameters API keys in Authorization header only
?api_key=YOUR_API_KEY Authorization: Bearer YOUR_API_KEY
No key roles/permissions API keys with specific permissions and roles

Code Example

v1.x Authentication
// JavaScript Example
fetch('https://api.zeebee.ai/v1/chat?api_key=YOUR_API_KEY', {
  method: 'POST',
  body: JSON.stringify({
    message: 'Hello, world!'
  })
});
v2.x Authentication
// JavaScript Example
fetch('https://api.zeebee.ai/v2/chat', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({
    message: 'Hello, world!'
  })
});

Endpoint Structure Changes

v1.x Endpoint v2.x Endpoint Notes
/v1/chat /v2/chat/completions The chat endpoint has been renamed for clarity
/v1/models /v2/models More detailed model information is now returned
/v1/conversations /v2/conversations Enhanced with search and filtering capabilities
N/A /v2/chat/completions/stream New endpoint for HTTP streaming
N/A /v2/chat/ws New WebSocket endpoint

Request/Response Format Changes

v1.x Chat Request
{
  "message": "Hello, how are you?",
  "conversation_id": "optional-conversation-id",
  "model": "gpt-3.5-turbo"
}
v2.x Chat Request
{
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "Hello, how are you?"
    }
  ],
  "model": "gpt-4-turbo",
  "conversation_id": "optional-conversation-id",
  "temperature": 0.7,
  "max_tokens": 1000
}
Important: The v2.x API requires a well-formed messages array instead of a single message string.

Error Handling Changes

In v2.x, errors now follow a more consistent format with clearer error codes:

v2.x Error Response
{
  "error": {
    "code": "invalid_request_error",
    "message": "The model 'gpt-5' does not exist or you don't have access to it.",
    "param": "model",
    "type": "invalid_request_error"
  }
}

SDK Changes

If you're using our official SDKs, you'll need to update to the latest versions:

JavaScript/TypeScript
// npm
npm uninstall zeebee-ai-sdk
npm install @zeebee-ai/sdk@2.0.0

// yarn
yarn remove zeebee-ai-sdk
yarn add @zeebee-ai/sdk@2.0.0
Python
pip uninstall zeebee-ai
pip install zeebee-ai==2.0.0

Migrating from v2.0 to v2.2 v2.0v2.2

Version 2.2 adds new features without breaking existing functionality. This is a minor update with no breaking changes.

New Features

Note: All v2.0 code should continue to work without changes, but we recommend upgrading to take advantage of new features.

Deprecation Notices

While no features are being removed in v2.2, the following features are planned for deprecation in v3.0:

Upgrade Checklist

Use this checklist to ensure a smooth migration:

Support

If you encounter any issues during migration, please don't hesitate to contact our support team: