> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Devin SDK overview

> Drive Devin from TypeScript with the Devin SDK: one session API for cloud and local Devin CLI sessions, with a typed client for the Devin REST API underneath.

The Devin SDK is a TypeScript toolkit for driving [Devin](https://devin.ai) from your own code.
One session API runs Devin in the cloud or as the Devin CLI on your machine, with a typed client
for the full [Devin REST API](https://docs.devin.ai/api-reference/overview.md) underneath. The packages are published to npm
under the `@cognition-ai` scope.

| Package | What it is |
| - | - |
| `@cognition-ai/sdk` | The SDK: `createDevin`, cloud and local sessions, streaming, structured output |
| `@cognition-ai/ai-sdk` | Devin session events as [AI SDK](https://ai-sdk.dev) UI message streams, for `useChat` — see [AI SDK UI](https://docs.devin.ai/sdk/ai-sdk/overview.md) |
| `@cognition-ai/cloudflare-agents` | A Devin cloud session behind a [Cloudflare Agents](https://developers.cloudflare.com/agents/) `AIChatAgent` — see [Cloudflare Agents](https://docs.devin.ai/sdk/cloudflare-agents/overview.md) |
| `@cognition-ai/harness-devin` | [AI SDK harness](https://ai-sdk.dev/providers/ai-sdk-harnesses) adapter for Devin — see [AI SDK harness](https://docs.devin.ai/sdk/harness/overview.md) |
| `@cognition-ai/cli-<os>-<cpu>` | Devin CLI binaries, installed automatically as optional dependencies of the SDK |

> [!NOTE]
>
> The `@cognition-ai` packages are in beta. Every release is a `0.0.1-beta.N` prerelease on the
> `beta` dist-tag (currently `0.0.1-beta.7`), so the `@beta` suffix is required: a bare
> `npm install @cognition-ai/sdk` fails on purpose. Pin the exact version in your lockfile, and keep
> every `@cognition-ai` package you use (`sdk`, `ai-sdk`, `cloudflare-agents`, `harness-devin`) on
> the same version; they release together. Each published version is stable, but the API can
> change between beta bumps; see the [changelog](https://docs.devin.ai/sdk/changelog.md) for what moved.

> [card] [Quickstart](https://docs.devin.ai/sdk/quickstart.md)
>
> Install the SDK, run a session, and print the reply.

> [card] [How it works](https://docs.devin.ai/sdk/how-it-works.md)
>
> Cloud vs. local sessions, and where the API client fits.

> [card] [Stream events](https://docs.devin.ai/sdk/guides/streaming-events.md)
>
> One typed event union for messages, thoughts, tool calls, and plans.

> [card] [API client](https://docs.devin.ai/sdk/api/overview.md)
>
> `devin.api`: a typed client for everything around sessions: PRs, playbooks, secrets, enterprise.

> [card] [Examples](https://docs.devin.ai/sdk/examples/overview.md)
>
> Six runnable programs, from a ten-line quickstart to Next.js and Cloudflare Agents chats.

> [card] [SDK reference](https://docs.devin.ai/sdk/reference/overview.md)
>
> Every class, function, and type `@cognition-ai/sdk` exports, generated from the source.

> [card] [Integrations](https://docs.devin.ai/sdk/ai-sdk/overview.md)
>
> Devin in other frameworks: AI SDK UI streams for `useChat`, Cloudflare Agents, and the AI SDK
> harness (`HarnessV1`).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.