Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"cliVersion": "5.149.0",
"cliVersion": "5.160.0",
"generatorName": "fernapi/fern-typescript-sdk",
"generatorVersion": "3.63.0",
"generatorConfig": {
Expand All @@ -11,10 +11,10 @@
"omitUndefined": true,
"enableInlineTypes": false
},
"originGitCommit": "d60758e7438e5ed4f06365c77535f6aedb9f0eb6",
"originGitCommit": "9c2d4590896be80f2c5e182c1972bcad068fc381",
"originGitCommitIsDirty": true,
"invokedBy": "ci",
"requestedVersion": "AUTO",
"ciProvider": "unknown",
"sdkVersion": "3.0.0"
"sdkVersion": "4.0.0"
}
8 changes: 7 additions & 1 deletion .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ci

on: [push]
on: [push, pull_request, workflow_dispatch]

permissions:
contents: read
Expand Down
15 changes: 15 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## [4.0.0] - 2026-10-16
### Breaking Changes
- See full changelog for all changes — no symbol-level breaking changes were identified in the diff; confirm with maintainers whether the MAJOR bump reflects internal contract changes not captured here.

### Added
- **`AnthropicModel.reasoningEffort`** and **`AnthropicBedrockModel.reasoningEffort`** — new optional fields to control adaptive thinking effort for `claude-haiku-5-5`, accepting values from `none` to `max`.
- **`baselineVersion`** — new optional display-only field added to all tool interfaces (`McpTool`, `OutputTool`, `QueryTool`, `SipRequestTool`, `SlackSendMessageTool`, `SmsTool`, `TextEditorTool`, `TransferCallTool`, `VoicemailTool`, `GhlTool`) returning the baseline label before a version is stored.
- **`ModelCostServiceTierBreakdown`** — new interface reporting per-OpenAI-service-tier cost and token counts, attached as the optional `serviceTierBreakdown` array on `ModelCost`.
- **`UserWithRole`**, **`UserWithRoleRole`**, and **`UserWithRoleRoleZero`** — new exported types representing an org member with their role and optional last-active timestamp.
- **`{{messagesWithConfidence}}` template variable** — now supported in structured output Liquid templates across all workflow model types and `StructuredOutput`/`CreateStructuredOutputDto`.
- **New model enum values** — `ClaudeHaiku55` added to `WorkflowAnthropicModelModel` and `WorkflowAnthropicBedrockModelModel`; `Gemini38Flash` added to `WorkflowGoogleModelModel`.

### Changed
- **`OpenAiModelServiceTier`** — documentation updated to clarify that `priority` is the legacy alias for `fast`, `auto` is the effective default when unset, and Fast mode billing is per-model and only charged when OpenAI confirms the request was served in Fast mode.

## [3.0.0] - 2026-10-08
### Breaking Changes
- **`ToolPinnedConflictResponseDtoError`** and the standalone **`ToolPinnedConflictResponseDto.error`** field have been removed from the SDK. The API still returns `error: "tool_pinned"` in pinned-tool HTTP 409 responses. After validating or narrowing the error body, use **`Vapi.ConflictErrorBody`** or **`Vapi.ConflictErrorBody.ToolPinned`** to read its `error` discriminator. Replace the removed constant with the literal `"tool_pinned"`. The `message` field contains the human-readable reason and does not replace the discriminator.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vapi-ai/server-sdk",
"version": "3.0.0",
"version": "4.0.0",
"private": false,
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions src/BaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export function normalizeClientOptions<T extends BaseClientOptions = BaseClientO
{
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "3.0.0",
"User-Agent": "@vapi-ai/server-sdk/3.0.0",
"X-Fern-SDK-Version": "4.0.0",
"User-Agent": "@vapi-ai/server-sdk/4.0.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
17 changes: 12 additions & 5 deletions src/api/resources/assistants/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ export class AssistantsClient {
* @param {Vapi.UpdateAssistantDto} request
* @param {AssistantsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Vapi.ConflictError}
*
* @example
* await client.assistants.update({
* id: "id"
Expand Down Expand Up @@ -411,11 +413,16 @@ export class AssistantsClient {
}

if (_response.error.reason === "status-code") {
throw new errors.VapiError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
switch (_response.error.statusCode) {
case 409:
throw new Vapi.ConflictError(_response.error.body as unknown, _response.rawResponse);
default:
throw new errors.VapiError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
}
}

return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/assistant/{id}");
Expand Down
9 changes: 7 additions & 2 deletions src/api/resources/simulationRuns/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js";
import { mergeHeaders } from "../../../../core/headers.js";
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js";
import * as core from "../../../../core/index.js";
import * as environments from "../../../../environments.js";
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
Expand Down Expand Up @@ -125,6 +125,7 @@ export class SimulationRunsClient {
* @param {SimulationRunsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Vapi.PaymentRequiredError}
* @throws {@link Vapi.ConflictError}
*
* @example
* await client.simulationRuns.simulationRunControllerCreate({
Expand All @@ -147,10 +148,12 @@ export class SimulationRunsClient {
request: Vapi.CreateSimulationRunDto,
requestOptions?: SimulationRunsClient.RequestOptions,
): Promise<core.WithRawResponse<Vapi.CreateSimulationRunResponse>> {
const { "Idempotency-Key": idempotencyKey, ..._body } = request;
const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
_authRequest.headers,
this._options?.headers,
mergeOnlyDefinedHeaders({ "Idempotency-Key": idempotencyKey }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
Expand All @@ -165,7 +168,7 @@ export class SimulationRunsClient {
contentType: "application/json",
queryParameters: requestOptions?.queryParams,
requestType: "json",
body: request,
body: _body,
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
Expand All @@ -183,6 +186,8 @@ export class SimulationRunsClient {
_response.error.body as Vapi.SimulationRunPaymentRequiredResponse,
_response.rawResponse,
);
case 409:
throw new Vapi.ConflictError(_response.error.body as unknown, _response.rawResponse);
default:
throw new errors.VapiError({
statusCode: _response.error.statusCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import type * as Vapi from "../../../../index.js";
* }
*/
export interface CreateSimulationRunDto {
/** Makes the request safe to retry. A retry with the same key and the same body returns the run the first request created, with `reused: true`, instead of starting another. Reusing a key with a different body returns 409. Up to 255 printable ASCII characters, scoped to your organization; a key stays bound to its run while the run exists. */
"Idempotency-Key"?: string;
/** Array of simulations and/or suites to run */
simulations: Vapi.CreateSimulationRunDtoSimulationsItem[];
/** Target to test against */
Expand Down
53 changes: 37 additions & 16 deletions src/api/resources/structuredOutputs/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as core from "../../../../core/index.js";
import * as environments from "../../../../environments.js";
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
import * as errors from "../../../../errors/index.js";
import type * as Vapi from "../../../index.js";
import * as Vapi from "../../../index.js";

export declare namespace StructuredOutputsClient {
export type Options = BaseClientOptions;
Expand Down Expand Up @@ -120,6 +120,8 @@ export class StructuredOutputsClient {
* @param {Vapi.CreateStructuredOutputDto} request
* @param {StructuredOutputsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Vapi.ConflictError}
*
* @example
* await client.structuredOutputs.structuredOutputControllerCreate({
* name: "name",
Expand Down Expand Up @@ -169,11 +171,16 @@ export class StructuredOutputsClient {
}

if (_response.error.reason === "status-code") {
throw new errors.VapiError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
switch (_response.error.statusCode) {
case 409:
throw new Vapi.ConflictError(_response.error.body as unknown, _response.rawResponse);
default:
throw new errors.VapiError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
}
}

return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/structured-output");
Expand Down Expand Up @@ -245,6 +252,8 @@ export class StructuredOutputsClient {
* @param {Vapi.StructuredOutputControllerRemoveRequest} request
* @param {StructuredOutputsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Vapi.ConflictError}
*
* @example
* await client.structuredOutputs.structuredOutputControllerRemove({
* id: "id"
Expand Down Expand Up @@ -289,11 +298,16 @@ export class StructuredOutputsClient {
}

if (_response.error.reason === "status-code") {
throw new errors.VapiError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
switch (_response.error.statusCode) {
case 409:
throw new Vapi.ConflictError(_response.error.body as unknown, _response.rawResponse);
default:
throw new errors.VapiError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
}
}

return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/structured-output/{id}");
Expand All @@ -305,6 +319,8 @@ export class StructuredOutputsClient {
* @param {Vapi.UpdateStructuredOutputDto} request
* @param {StructuredOutputsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Vapi.ConflictError}
*
* @example
* await client.structuredOutputs.structuredOutputControllerUpdate({
* id: "id",
Expand Down Expand Up @@ -356,11 +372,16 @@ export class StructuredOutputsClient {
}

if (_response.error.reason === "status-code") {
throw new errors.VapiError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
switch (_response.error.statusCode) {
case 409:
throw new Vapi.ConflictError(_response.error.body as unknown, _response.rawResponse);
default:
throw new errors.VapiError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
}
}

return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/structured-output/{id}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export interface UpdateStructuredOutputDto {
* This is the model that will be used to extract the structured output.
*
* To provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages.
* Between the system or user messages, you must reference either 'transcript' or 'messages' with the `{{}}` syntax to access the conversation history.
* For text extraction, you must reference 'transcript', 'messages', or 'messagesWithConfidence' with the `{{}}` syntax to access the conversation history.
* In structured outputs, `{{messages}}` includes conversation text and tool calls/results but omits caller transcription-confidence fields. Text extraction can use `{{messagesWithConfidence}}` when the output needs the original message history with transcription confidence. These variables also apply in structured-output schema descriptions. Audio-targeted (`messages-with-audio`) extraction ignores custom messages. Stored call artifacts and API messages retain their confidence data.
* Between the system or user messages, you must reference a variation of the structured output with the `{{}}` syntax to access the structured output definition.
* i.e.:
* `{{structuredOutput}}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import type * as Vapi from "../../../index.js";

export type StructuredOutputControllerRunResponse =
| Vapi.StructuredOutputControllerRunResponseZero
| Vapi.StructuredOutputRerunResponse;
| Vapi.StructuredOutputRerunResponse
| Vapi.StructuredOutputControllerRunResponseOne;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type * as Vapi from "../../../index.js";

export interface StructuredOutputControllerRunResponseZero {
export interface StructuredOutputControllerRunResponseOne {
/**
* These are the structured outputs whose conditions gated them, keyed by
* structured output id. Absent when nothing was skipped. An entry here means
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import type * as Vapi from "../../../index.js";
* This is the model that will be used to extract the structured output.
*
* To provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages.
* Between the system or user messages, you must reference either 'transcript' or 'messages' with the `{{}}` syntax to access the conversation history.
* For text extraction, you must reference 'transcript', 'messages', or 'messagesWithConfidence' with the `{{}}` syntax to access the conversation history.
* In structured outputs, `{{messages}}` includes conversation text and tool calls/results but omits caller transcription-confidence fields. Text extraction can use `{{messagesWithConfidence}}` when the output needs the original message history with transcription confidence. These variables also apply in structured-output schema descriptions. Audio-targeted (`messages-with-audio`) extraction ignores custom messages. Stored call artifacts and API messages retain their confidence data.
* Between the system or user messages, you must reference a variation of the structured output with the `{{}}` syntax to access the structured output definition.
* i.e.:
* `{{structuredOutput}}`
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/structuredOutputs/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export * from "./StructuredOutputControllerFindAllRequestSortBy.js";
export * from "./StructuredOutputControllerFindAllRequestSortOrder.js";
export * from "./StructuredOutputControllerRunResponse.js";
export * from "./StructuredOutputControllerRunResponseZero.js";
export * from "./StructuredOutputControllerRunResponseOne.js";
export * from "./UpdateStructuredOutputDtoConditionsItem.js";
export * from "./UpdateStructuredOutputDtoModel.js";
export * from "./UpdateStructuredOutputDtoType.js";
10 changes: 8 additions & 2 deletions src/api/resources/tools/types/CreateToolsRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export type CreateToolsRequest =
| Vapi.CreateToolsRequest.GohighlevelContactCreate
| Vapi.CreateToolsRequest.GohighlevelContactGet
| Vapi.CreateToolsRequest.SipRequest
| Vapi.CreateToolsRequest.Voicemail;
| Vapi.CreateToolsRequest.Voicemail
| Vapi.CreateToolsRequest.Code;

export namespace CreateToolsRequest {
export interface ApiRequest extends Vapi.CreateApiRequestToolDto {
Expand Down Expand Up @@ -115,6 +116,10 @@ export namespace CreateToolsRequest {
type: "voicemail";
}

export interface Code extends Vapi.CreateCodeToolDto {
type: "code";
}

export type Response =
| Vapi.CreateToolsRequest.ApiRequest
| Vapi.CreateToolsRequest.Dtmf
Expand All @@ -137,5 +142,6 @@ export namespace CreateToolsRequest {
| Vapi.CreateToolsRequest.GohighlevelContactCreate
| Vapi.CreateToolsRequest.GohighlevelContactGet
| Vapi.CreateToolsRequest.SipRequest
| Vapi.CreateToolsRequest.Voicemail;
| Vapi.CreateToolsRequest.Voicemail
| Vapi.CreateToolsRequest.Code;
}
Loading
Loading