TypeScript SDK

The official SDK is @aweb/sdk. It wraps public Aweb V2 routes, lifecycle receipts, discovery, and Maestro orchestration over the same catalog that currently reports 245 provider surfaces and 506 MCP tools.

Install

npm install @aweb/sdk

Initialize

import Aweb from '@aweb/sdk';

const aweb = new Aweb({
  apiKey: process.env.AWEB_API_KEY,
  // Optional. Defaults to the public Aweb V2 API in the SDK package.
  baseUrl: process.env.AWEB_API_URL ?? 'https://aweblabs.ai/api/v2',
  timeout: 60_000,
  maxRetries: 3,
});

First calls

const response = await aweb.responses.create({
  input: 'Summarize what Aweb does in one paragraph.',
});

const chat = await aweb.chat.completions.create({
  messages: [{ role: 'user', content: 'Explain provider routing.' }],
});

const capabilities = await aweb.capabilities.list({ family: 'research' });

console.log(response.data.id);
console.log(chat.data.choices[0]?.message.content);
console.log(capabilities.count);

Resources exposed today

responsesaweb.responses.create()Responses-style model output and streaming
chataweb.chat.completions.create()OpenAI-compatible chat completion surface
imagesaweb.images.generate(), upscale(), edit()Image generation and editing routes
videosaweb.videos.generate(), fromImage()Video generation routes
audioaweb.audio.speech(), transcriptions(), music()Speech, transcription, and music
capabilitiesaweb.capabilities.list(), get(), families()Public capability discovery
orchestrateaweb.orchestrate.run(), get()Maestro jobs, runs, checkpoints, and receipts
batchaweb.batch.create(), list(), get(), cancel()Batch lifecycle commands
keysaweb.keys.rotate()Key rotation for authenticated workspaces

Maestro orchestration and receipts

Orchestration responses include durable job/run identity and audit receipts when the route produces lifecycle metadata.

const run = await aweb.orchestrate.run({
  query: 'Research competitors and draft launch positioning',
  capabilities: ['search.web', 'llm.chat'],
  policy: 'balanced',
});

console.log(run.data.job?.id);
console.log(run.data.run?.status);
console.log(run.data.audit_receipt?.request_id);

MCP boundary

The SDK is the public TypeScript client for REST/V2 routes. MCP access is exposed through the MCP manifest and server, and is documented separately because tool invocation is governed by auth, policy, and OS9/Mission Contract boundaries.

Error handling

import Aweb, { AwebError, AwebTimeoutError } from '@aweb/sdk';

try {
  await aweb.responses.create({ input: 'hello' });
} catch (error) {
  if (error instanceof AwebTimeoutError) {
    console.error('Timed out:', error.message);
  }

  if (error instanceof AwebError) {
    console.error(error.status);
    console.error(error.type);
    console.error(error.requestId);
    console.error(error.detail);
  }
}

Truth boundaries

  • The SDK package source is packages/aweb-sdk.
  • Public discovery routes can be called without a key; execution routes require auth.
  • Private beta systems such as MCP tool execution require approved access.
  • Provider and MCP counts should come from the integration catalog, not page literals.