Reference

API Client Reference

Programmatic HTTP client options, resources, methods, and errors.

@isplay/api-client wraps the HTTP API and throws structured errors for failed responses.

Imports

import {
  IsplayApiClient,
  IsplayApiError,
  type ApiClientOptions,
} from "@isplay/api-client";

Options

const api = new IsplayApiClient({
  baseUrl: process.env.ISPLAY_API_URL,
  headers: { authorization: `Bearer ${token}` },
  fetch: customFetch,
});
OptionDefaultNotes
baseUrlISPLAY_API_URL or http://127.0.0.1:7373API origin.
headersnoneStatic headers added to requests.
fetchglobal fetchUseful for tests, proxies, or instrumentation.

Resource Objects

ResourcePurpose
projectsCreate/get projects and project catalog.
runsRuns, events, artifacts, checkpoints, model/tool records, run catalog, run context inventory.
branchesFetch branches and create/list interventions.
replaysCreate/get replays, events, diffs, metrics, requirements, fixtures, resume, effects.
analysisExperiments, hypothesis batches, context search, analysis runs, effect ranking.

Top-Level Convenience Methods

IsplayApiClient exposes top-level methods for the main resource operations: health, createProject, createRun, appendEvents, createBranch, createReplay, createExperiment, runExperiment, createAnalysisRun, rankEffects, and related getters.

Error Behavior

Failed API responses throw IsplayApiError with:

FieldMeaning
statusHTTP status.
bodyParsed error body when available.
methodHTTP method.
pathRequest path.

Use this when building scripts that need retry or user-facing diagnostics.

On this page