TypeScript SDKAPI reference
API reference
Every public class, method, and type exported by the Bastion TypeScript SDK.
The SDK's public surface is exported from a single entry point: @qubittron/bastion-sdk. Everything documented here is type-checked against the source in packages/sdk/src.
Entry point
import {
Bastion,
Stream,
// error classes
BastionError,
APIError,
APIConnectionError,
AuthenticationError,
BadRequestError,
NotFoundError,
PermissionDeniedError,
RateLimitError,
UpstreamError,
// constants
SpeechEncoding,
} from "@qubittron/bastion-sdk";
import type {
// chat
ChatCompletion,
ChatCompletionChunk,
ChatCompletionCreateParams,
ChatCompletionCreateParamsNonStreaming,
ChatCompletionCreateParamsStreaming,
ChatChoiceDelta,
// client
ClientOptions,
// images
ImageData,
ImageGenerateParams,
ImageGenerateResponse,
// models
Model,
ModelList,
// audio
SpeechParams,
SpeechResponse,
TranscriptionParams,
TranscriptionResponse,
TranscriptionSegment,
} from "@qubittron/bastion-sdk";ChatChoice, ChatMessage, and TokenUsage are re-exported from @qubi_bastion/shared and are part of the public type surface.
Resources
Bastion client
Constructor, ClientOptions, defaults.
chat
chat.completions.create — sync and streaming.
models
models.list — discover available models.
images
images.generate — text-to-image.
audio
audio.speech (TTS) + audio.transcriptions.create (STT).
Stream
AsyncIterable returned by streaming calls.
Errors
BastionError hierarchy and HTTP→class mapping.