SDK reference

@sequelsh/core has no agent-framework dependencies. Adapters import it, not the other way round.

new Sequel(options)

OptionTypeNotes
apiKeystringFalls back to SEQUEL_API_KEY
baseUrlstringFalls back to SEQUEL_BASE_URL, then the hosted API
toolsetToolsetDefault for tools(); overridable per call
fetchtypeof fetchSwapped in tests
OptionTypeNotes
querystringSemantic. Omit to browse
type'image' | 'video' | 'audio'Narrow by modality
limitnumberDefault 10
ts
const models = await sequel.search({ query: 'talking avatar', type: 'video' });

schema(modelId)

Returns { id, modality, capabilities, inputSchema, rates }. inputSchema is JSON Schema and is the authority on what the model accepts.

run(options)

OptionTypeNotes
modelstringRequired. From search — never invented
paramsobjectThe model's own input object
promptstringShorthand folded into params.prompt
signalAbortSignalCancels the request, not the run

Returns a TaskHandle: .task is the task as it stands, .done whether it settled, .wait(options) polls until it does.

runMany(runs)

Takes an array of the same options. Parallel, returned in order.

tasks

ts
await sequel.tasks.get(id);
await sequel.tasks.list({ status, models, start, end, limit });

upload / uploadUrl

ts
const url = await sequel.upload(file);            // does the PUT for you
const target = await sequel.uploadUrl('image/png'); // or do it yourself

tools(options)

OptionTypeNotes
mode'discovery' | 'per-model'Default 'discovery'
typeModality | Modality[]per-model only
modelsstring[]per-model only
toolsetToolsetOverrides the constructor default
ts
import { AISDKToolset } from '@sequelsh/ai-sdk';

const sequel = new Sequel({ apiKey, toolset: new AISDKToolset() });

await sequel.tools();
// search_models, get_model_schemas, run_models — constant prompt cost

await sequel.tools({ models: ['black-forest-labs/flux-1-schnell'], mode: 'per-model' });
// generate_cf_black_forest_labs_flux_1_schnell, with that model's schema

Discovery unless the model list is short and fixed. Per-model puts every schema in the prompt, which is fine for three and expensive for twenty.

Errors

Any non-2xx throws SequelError with status, message from the server, and the parsed body.