---
title: "System One AI SDK (npm) for typed decisions."
description: "Use the System One AI SDK (npm) to add structured decisions with one evaluate() call. Define choices, scoring rubrics, and yes/no questions, then use typed answers in your application."
canonical: "https://system-one.dev/en/sdk"
language: "en"
---

# System One AI SDK (npm) for typed decisions.

Use the System One AI SDK (npm) to add structured decisions with one evaluate() call. Define choices, scoring rubrics, and yes/no questions, then use typed answers in your application.

Open source · TypeScript · Node.js

## Install the SDK

```sh
npm install @system-one-ai/core@0.8.0 @system-one-ai/adapter-system-one@0.7.0 @system-one-ai/transport-fetch@0.8.0
```
## Connect a model service

Install core, the service adapter, and a transport. Configure systemOneAdapter and createFetchTransport() for System One API. Keep credentials in your server environment.

```ts
import { createSystemOne, choice } from '@system-one-ai/core';
import { systemOneAdapter } from '@system-one-ai/adapter-system-one';
import { createFetchTransport } from '@system-one-ai/transport-fetch';

const client = createSystemOne({
  adapter: systemOneAdapter,
  transport: createFetchTransport(),
  baseURL: process.env.SYSTEM_ONE_BASE_URL!,
  apiKey: process.env.SYSTEM_ONE_API_KEY!,
  maxRetries: 0,
});

const result = await client.evaluate({
  state: { message: 'I was charged twice.' },
  questions: {
    team: choice('Who should handle this?', {
      billing: 'Payments and refunds',
      support: 'Technical issues',
    }),
  },
});

result.answers.team.choice; // 'billing' | 'support'
```
## One interface for structured decisions

### Types from question to answer

Choice results retain your option names as TypeScript literal types. Scores and yes/no probabilities return as numbers.

### Connect your provider

Use System One API directly. An optional Vercel AI SDK adapter connects other supported model services.

### Control request behavior

Configure timeouts and retries, cancel with AbortSignal, and handle typed errors in your application.

## Connect to System One API

Use your System One API key to call the hosted service. Test inputs in the Playground and review request usage in the console.

[Connect SDK to hosted API](https://docs.system-one.dev/en/docs/getting-started)

## Start here

- [Developer documentation](https://docs.system-one.dev/en)
- [Versioning and deprecation](https://docs.system-one.dev/en/docs/api/versioning)
- [Idempotency and retries](https://docs.system-one.dev/en/docs/api/idempotency)
- [API errors](https://docs.system-one.dev/en/docs/api/errors)
- [TypeScript SDK](https://system-one.dev/en/sdk)
- [API reference](https://system-one.dev/en/api)
- [Models](https://system-one.dev/en/models)
- [Model catalog](https://docs.system-one.dev/en/docs/models)
- [Authentication](https://system-one.dev/en/auth.md)
- [Pricing](https://system-one.dev/en/pricing)
- [Credit billing](https://docs.system-one.dev/en/docs/billing)
- [OpenAPI specification](https://system-one.dev/openapi.json)
- [Agent integration guide](https://system-one.dev/en/skill.md)
- [System One for Coding Agents: Cursor, Claude Code, Codex](https://docs.system-one.dev/en/docs/coding-agents)
- [Installable coding-agent skill](https://system-one.dev/skills/system-one/SKILL.md)
- [About](https://system-one.dev/en/about)
- [Contact](https://system-one.dev/en/contact)
- [Playground samples](https://system-one.dev/en/demo)
- [Blog](https://system-one.dev/en/blog)
- [SDK source](https://github.com/ziyu/system-one-sdk)
- [@system-one-ai/core (npm)](https://www.npmjs.com/package/@system-one-ai/core)
