Skip to main content
The @to11ai/sdk package gives TypeScript and JavaScript applications typed access to to11. You use it to render managed prompts at runtime, shaped for the provider client you already use, and to manage prompts, versions, skills, and project environments from code. The SDK talks to the to11 API (https://api.to11.ai). It never sends the model request itself — there is no .chat(). Your own provider client (OpenAI, Anthropic, or any other) sends the rendered prompt to the provider, with your own provider key. The package is published under the MPL-2.0 license and ships ESM, CommonJS, and TypeScript source in one package.

Runtime requirements

  • Runtimes: Node (both ESM and CommonJS), Bun, Deno, and edge runtimes, on a server, in a CLI, or in a backend job. No minimum Node version is declared.
  • Not in a browser: a to11 API key must never ship in client code, so the SDK throws if you pass apiKey in a browser context.
  • Credentials: a to11 API key and a project id. The SDK reads TO11_API_KEY and TO11_PROJECT_ID from the environment, and TO11_API_URL for the API address, which defaults to https://api.to11.ai.

Installation

Install your provider client, such as openai or @anthropic-ai/sdk, separately; the SDK does not depend on it.

The happy path

Create a client, render a prompt shaped for OpenAI, and send it with your OpenAI client:
prompt.config carries the model settings from the prompt version’s Config pane, prompt.messages the rendered messages, and prompt.metadata which prompt version produced them, for your own logging.

Where to next

Configuration

Client options, credential resolution, and what the client exposes.

Rendering prompts

Formats, the rendered result shape, and the converters.

Prompt management

Prompt lifecycle, versions, labels, skills, and project environments.

Errors

The typed error classes the SDK throws, and how to catch them.