@vel4ai/sdk Reference
@vel4ai/sdk is the framework-agnostic public entry point. It does not depend on AI SDK or LangChain.
Client
Section titled “Client”| API | Purpose |
|---|---|
new VelaClient({ baseUrl, appId, appToken }) | Manual initialization from a secret store or similar source |
createVelaClientFromEnvironment({ env }) | Initialize from VELA_APP_ID / VELA_APP_TOKEN |
createFetchTransport() | Create custom headers or test transports |
Hosted Connect / Scope
Section titled “Hosted Connect / Scope”| API | Purpose |
|---|---|
client.createConnectSession() | Issue a Hosted Connect URL |
resolveVelaExecutionScopeFromUrl() | Normalize return URL query params |
resolveVelaExecutionScope() | Normalize saved objects or request bodies |
createVelaIntegration() | Bind a client and execution scope |
Readiness / Execution
Section titled “Readiness / Execution”| API | Purpose |
|---|---|
checkVelaIntegrationReadiness() | Check status without authorization |
integration.checkReadiness() | Scope-bound readiness check |
prepareExecution() | Low-level helper that returns the raw outcome |
prepareExecutionWithFailure() | Normalize blocked / deny into the failure shape |
prepareExecutionWithResponse() | Create a Web Response for Fetch API routes |
Model Helpers
Section titled “Model Helpers”| API | Purpose |
|---|---|
createLockedModelSlot() | Strict model selection |
createUserSelectableModelSlot() | Select from compatible model candidates |
createCapabilityModelRequirement() | Specify capabilities, modalities, and preferences |
createExactModelRequest() | Compatibility exact request |
createOrderedModelRequest() | Compatibility ordered candidates |
resolveModelRequest() | Local resolution from a status snapshot and model input |
Reporting / Responses
Section titled “Reporting / Responses”| API | Purpose |
|---|---|
createOpenAiCompatibleUsageReportInput() | Convert OpenAI-compatible usage to report input |
createUsageSummary() | Normalize tokens and cost into an audit payload |
createExecutionResultReporter() | Create an idempotent reporter |
createPreparedExecutionFailureHttpResponse() | Framework-agnostic HTTP descriptor |
createPreparedExecutionFailureResponse() | Web JSON Response |
createVelaEnvironmentDiagnosticsResponse() | Missing environment response |
createVelaErrorResponse() | Unexpected error response |
Minimum Import Smoke
Section titled “Minimum Import Smoke”import { VelaClient, createLockedModelSlot, createVelaClientFromEnvironment, createVelaIntegration, prepareExecutionWithResponse,} from "@vel4ai/sdk";
export const sdkReferenceSmoke = { VelaClient, createLockedModelSlot, createVelaClientFromEnvironment, createVelaIntegration, prepareExecutionWithResponse,};