November 5, 2026 · TwelveLabs
TwelveLabs SDKs 1.3.8 change Responses API types, removing usage for billing
Version 1.3.8 of the Python and Node.js SDKs changes the types for the Responses API. Upgrading can require changes to your code, depending on the version that you have installed. The API is unchanged. Follow these steps to upgrade.
Check the installed version of the SDK
Note the version. You need it after the upgrade.
Python SDK
pip show twelvelabs
Node.js SDK
npm ls twelvelabs-js
Upgrade the SDK
Install the latest version of the SDK:
Python SDK
pip install --upgrade twelvelabs
Node.js SDK
npm install twelvelabs-js@latest
Update your code
Select the tab for your previous version of the SDK.
1.3.6 or earlier
SDK type changes (breaking change)
The usage field is removed. This change affects you if your code reads the usage field or uses the ResponseUsage type. To find the cost of a response, read the billing field. It contains the amount and the currency. It does not contain token counts.
Python
Before:
Python
usage = response.usage
print(usage.input_tokens, usage.output_tokens)
After:
Python
billing = response.billing
print(billing.amount, billing.currency)
Node.js
Before:
Node.js
const usage = response.usage;
console.log(usage?.inputTokens, usage?.outputTokens);
After:
Node.js
const billing = response.billing;
console.log(billing?.amount, billing?.currency);
The keepalive stream event type is removed. This change affects you if your code uses the ResponseStreamKeepAliveEvent type. Remove the code that handles it.
The status field of an output item is an optional string. This change affects you if your code reads the status field and assumes that it has a value.
Other SDK type changes
- The
typefield ofResponseOutputItemis a string. The SDK still exportsResponseOutputItemTypewith the valuesmessage,function_call, andfunction_call_output. - The
typefield ofResponseAnnotationis a string. The SDK still exportsResponseAnnotationTypewith the valuesvideo_citation,image_citation, andcollection_citation. The platform also returns theurl_citationvalue. - An output item with the
jockey:web_searchtype contains the details of the search in theactionfield. The response stream includes thejockey:web_search.in_progress,jockey:web_search.searching, andjockey:web_search.completedevents. The response contains these items and events only when the request sets theincludeparameter to["intermediate_outputs"].
1.3.7
SDK type changes (breaking change)
ResponseOutputItem is one type, not a union. This change affects you if your code uses a variant of ResponseOutputItem. Use ResponseOutputItem instead, and read the type field to tell output items apart.
Python
The SDK no longer includes these types:
ResponseOutputItem_MessageResponseOutputItem_FunctionCallResponseOutputItem_FunctionCallOutputResponseOutputItem_JockeyWebSearch
Before:
Python
from twelvelabs import ResponseOutputItem_Message
for item in response.output:
if isinstance(item, ResponseOutputItem_Message):
print(item.content)
After:
Python
for item in response.output:
if item.type == "message":
print(item.content)
Node.js
The SDK no longer includes these types:
ResponseOutputItem.MessageResponseOutputItem.FunctionCallResponseOutputItem.FunctionCallOutputResponseOutputItem.JockeyWebSearch
Before:
Node.js
import { TwelvelabsApi } from "twelvelabs-js";
function printMessage(item: TwelvelabsApi.ResponseOutputItem.Message) {
console.log(item.content);
}
After:
Node.js
import { TwelvelabsApi } from "twelvelabs-js";
function printMessage(item: TwelvelabsApi.ResponseOutputItem) {
if (item.type === "message") {
console.log(item.content);
}
}
The status field of an output item is an optional string. This change affects you if your code reads the status field and assumes that it has a value.
More information
For details, see the Create a response page in the API Reference section, or the SDK reference for Python and Node.js.
Latest TwelveLabs API changes
Free plan now 10 requests/minute, 200/day; Plus and Pro 30/minute, 1,000/day
List knowledge stores can be filtered by asset with asset_id
Knowledge store items can be filtered by 1 to 50 asset IDs when listing
Fractional embedding segment lengths documented as valid; Marengo 3.0 ignores the fraction
activity_summaries added for streaming progress; intermediate_outputs deprecated