Skip to main content
@singularity-layer/grid is the official TypeScript/JavaScript client for SGL Grid. Typed methods over the grid’s HTTP API; zero dependencies; native fetch (Node ≥ 18, modern browsers, edge runtimes).

Install

Quick start

Configuration

  • No key → public reads (capacity, models, pricing) work.
  • API key → required for submitJob, getJob, getAttestation, and billed chat. Create keys in the dashboard (see Billing).

Discovery (no auth)

Chat completions

Embeddings

Turn text into vectors for search and RAG via the OpenAI-compatible /v1/embeddings endpoint. Returns the OpenAI-style response with data ordered to match input. See the Embeddings guide for the model catalog and options.

Jobs + attestation

See Confidential inference for what the attestation proves.

Error handling

Or use the OpenAI SDK

The grid is OpenAI-compatible — skip this client if you just want drop-in chat:
Use @singularity-layer/grid for grid-native features (capacity, pricing, jobs, attestation). See the API guide and the Python SDK.