Files
cline/docs/enterprise-solutions/api-reference.mdx
T
0b0ca9b1fa docs: add SDK documentation (#10350)
* docs: add comprehensive SDK documentation as top-level tab

Adds 27 new documentation pages for the Cline SDK (@clinebot/core,
@clinebot/agents, @clinebot/llms, @clinebot/shared) organized into
a dedicated "SDK" tab in the Mintlify docs navigation.

Structure:
- Getting Started: overview, quickstart, examples
- Core Concepts: agents, sessions, tools, streaming/events, extensions,
  hooks, providers/models
- Guides: building an agent, custom tools, writing extensions, permission
  handling, scheduled agents, multi-agent teams, connectors, production
- Architecture: layered stack overview, hub-spoke RPC, package reference
- API Reference: ClineCore, Agent, Gateway, Tools API, Events, Types
- CLI: commands, configuration, connector setup

Removes the old single-page SDK overview (cline-sdk/overview.md) that
documented the previous ACP-based ClineAgent API, and removes its
reference from the Cline CLI navigation group.

* docs: fix SDK docs review feedback

- Change "desktop app" to "JetBrains plugin" in overview (not released yet)
- Rename "Providers & Models" to "Model Providers"
- Rename "Streaming & Events" to "Streaming Events"
- Remove duplicate cli/connectors.mdx (guides/connectors.mdx covers everything)

* docs: add wizard commands, Discord connector, and platform credential details

* feat(docs): create CLI tab with new feature pages and updated reference

- Add CLI as its own top-level tab in docs navigation
- Remove CLI group from Docs tab and SDK tab
- Delete SDK CLI pages (content moved to CLI tab)
- Add new feature pages: connectors, scheduling, MCP servers, agent teams
- Rewrite cli-reference.mdx with all new commands (connect, mcp, schedule,
  rpc, checkpoint, doctor) and new flags (reasoning-effort, thinking,
  sandbox, teams, spawn, tool-enable/disable, autoapprove)
- Update configuration.mdx with new directory structure, env vars
  (CLINE_DATA_DIR, CLINE_RPC_ADDRESS, CLINE_SESSION_BACKEND_MODE,
  CLINE_SANDBOX), and MCP wizard reference

* docs: rename Docs tab to Extension and reorder tabs

Tab order: Extension, CLI, SDK, Kanban, Enterprise, API, Learn

* docs: simplify SDK install to single @clinebot/core package

@clinebot/core re-exports from agents, llms, and shared, so users
only need one install and one import source. Updated all getting-started,
quickstart, examples, and guide pages to import from @clinebot/core.
Concept and reference pages keep individual package imports since they
document those specific packages.

* docs: use @clinebot/sdk as the primary install and import path

@clinebot/sdk is an alias for @clinebot/core that re-exports from all
packages. All user-facing pages (overview, quickstart, examples, guides)
now show npm install @clinebot/sdk and import from @clinebot/sdk.
Architecture and reference pages keep individual package names since
they document the internal package structure.

* docs: rename Extension tab to Cline

* docs: fix packages page and merge duplicate imports

* fix: use getting-started page in CLI tab nav and remove conflicting redirect

* docs: rename CLI Getting Started page title to Overview

* docs: rename cline-cli/ to cli/ and cline-sdk/ to sdk/

Shorter, cleaner URL paths. Updated all internal links across every
doc page and added 44 redirects for old paths so existing URLs
don't break.

* docs: update hub-spoke architecture from gRPC/RPC to WebSockets

- Rewrite hub-spoke.mdx: WebSocket protocol, capability brokerage,
  spoke workers, session participants, hub daemon discovery
- Replace all RPC/gRPC/sidecar references with hub/WebSocket across
  all SDK and CLI docs
- Backend modes: local/hub/remote/auto (was local/rpc/auto)
- Hub command replaces rpc command (cline hub start/stop/status/ensure)
- Default port 25463 (was 4317), log file hub-daemon.log
- Remove @clinebot/rpc and @clinebot/scheduler from architecture docs
  (functionality absorbed into @clinebot/core)
- Update ClineCore reference to remove rpc options
- Add capability brokerage and session participant concepts

* docs: add Ecosystem page to SDK tab

* docs: move Ecosystem page after Guides and fix opening sentence

* docs: rename extensions to plugins across all SDK and CLI docs

- Rename AgentExtension to AgentPlugin in all code examples
- Rename ExtensionAPI to PluginAPI
- Rename extensions.mdx to plugins.mdx, writing-extensions.mdx to writing-plugins.mdx
- Rename all variable names (databaseExtension -> databasePlugin, etc.)
- Rename config field from extensions to plugins
- Update all prose, section headers, and cross-links
- Add redirects for old paths

* clean up attempt 1

* remove deprecated features

* part 1 of large provider changes

* a large pass on workflows

* cli ref updates

* config rewrite

* more concise instsallation and model selection

* provider reorg cont

* update providers

* one step further cleaning up

* kanban finishing clean up

* wip...

* another big cleanup - remove the CLI tabgroup

* sdk tighten up pt1

* more sdk doc tightening

* making more progress

* doc update based on bee latest branch

* nit update on codepaths

* remove learn section

* docs: add plugin install command documentation

Document the new clite plugin install command across CLI reference,
customization plugins page, SDK plugins concept page, and the writing
plugins guide. Cover all three source types (npm, git, local), the
package.json manifest format with cline.plugins field, host-provided
dependency handling, auto-detection logic, and the install directory
structure.

Reference cline/typescript-lsp-plugin as a concrete install example.

* docs: deduplicate plugin install docs

Trim redundant plugin install content from CLI reference, SDK plugins
concept page, and writing-plugins guide. Each now links to the
customization/plugins page as the single source of truth for manifest
format, install commands, and directory layout.

* further simplify the doc

* further clean up

* mark warnings

* docs: rename @clinebot to @cline and clite to cline

SDK packages moved to the @cline npm org. Update all docs references
to use @cline/sdk, @cline/agents, @cline/core, @cline/shared, @cline/llms
and the cline CLI binary name.

* docs: streamline SDK docs with example references (#10617)

* docs: streamline SDK docs with example references and @cline/sdk imports

Replace large standalone code blobs in SDK docs with references to
working examples in the SDK repository. Users can now clone and run
real code instead of copy-pasting from docs.

- Update all imports from @cline/agents, @cline/core, @cline/shared
  to @cline/sdk (the public-facing package)
- Fix model IDs from claude-sonnet-4-6 to claude-sonnet-4-20250514
- Quickstart: trim duplicate code patterns, add cards linking to
  cli-agent, code-review-bot, multi-agent, desktop-app examples
- Overview: add examples table with difficulty progression, update
  install instructions to use @cline/sdk
- Building an Agent: rewrite as a walkthrough of the code-review-bot
  example rather than inline code blobs across 4 separate files
- Creating Custom Tools: rewrite to use createTool with zod, add
  completion tools section, reference working examples
- Tools: show createTool with zod as primary pattern
- Events: reference multi-agent example for streaming UI pattern
- Architecture: update install to @cline/sdk

* fix: use claude-sonnet-4-6 model ID across all SDK docs

* remove connector page from sdk

* small reordering

* clean up sdk app and plugin examples

---------

Co-authored-by: Renee Huang <renee@cline.bot>

* remove features/connectors

* doc revisions

* fix references after folder change

* docs: fix SDK review feedback after rebase

* docs: address Greptile SDK review feedback

* docs: move TUI page under CLI nav

* docs: restore TUI page placement

---------

Co-authored-by: Renee Huang <renee@cline.bot>
Co-authored-by: John Simone <john@cline.bot>
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
2026-05-12 16:55:33 -07:00

209 lines
8.1 KiB
Plaintext

---
title: "Enterprise API Reference"
sidebarTitle: "API Reference"
description: "REST API endpoints for managing users, organizations, billing, plans, and API keys."
---
The Enterprise API provides REST endpoints for account management, organization administration, billing, and API key management. These are separate from the [Chat Completions API](/api/overview), which handles model inference.
## Base URL
```
https://api.cline.bot
```
## Authentication
All endpoints require a Bearer token in the `Authorization` header:
```bash
Authorization: Bearer YOUR_AUTH_TOKEN
```
Use the same API key or account auth token described in the [public API reference](/api/overview#authentication).
## Quick Example
```bash
# Get your user profile
curl https://api.cline.bot/api/v1/users/me \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"
```
```json
{
"id": "user_abc123",
"email": "you@company.com",
"name": "Your Name",
"active_account_id": "org_xyz789"
}
```
---
## Users
Manage user accounts, accept terms, check balances, view usage, and configure payment methods.
| Method | Endpoint | Description |
|--------|----------|-------------|
| `GET` | `/api/v1/users/me` | Get current user profile |
| `PATCH` | `/api/v1/users/me` | Update current user profile |
| `DELETE` | `/api/v1/users/me` | Delete current user account |
| `POST` | `/api/v1/users/me/accept-terms` | Accept terms of service |
| `GET` | `/api/v1/users/me/remote-config` | Get remote configuration for the current user |
| `PUT` | `/api/v1/users/active-account` | Switch active account (personal or organization) |
| `GET` | `/api/v1/users/{id}/balance` | Get credit balance |
| `GET` | `/api/v1/users/{id}/usages` | Get usage history |
### Payments and Credits
| Method | Endpoint | Description |
|--------|----------|-------------|
| `GET` | `/api/v1/users/{id}/payments` | List payment history |
| `GET` | `/api/v1/users/{id}/payments/{paymentId}` | Get payment details |
| `GET` | `/api/v1/users/{id}/payments/{paymentId}/status` | Check payment status |
| `GET` | `/api/v1/users/{id}/payments/provider/{paymentId}` | Get provider-side payment details |
| `POST` | `/api/v1/users/credits/checkout` | Start a credit purchase checkout |
| `POST` | `/api/v1/users/{id}/credits/purchase` | Purchase credits directly |
### Billing Configuration
| Method | Endpoint | Description |
|--------|----------|-------------|
| `GET` | `/api/v1/users/{id}/auto-top-up` | Get auto top-up settings |
| `PUT` | `/api/v1/users/{id}/auto-top-up` | Configure auto top-up |
| `GET` | `/api/v1/users/{id}/payment-method/default` | Get default payment method |
| `POST` | `/api/v1/users/{id}/payment-method/setup-session` | Start payment method setup |
| `GET` | `/api/v1/users/{id}/promotions` | List active promotions |
---
## Organizations
Create and manage organizations. Organization admins can configure remote settings, manage members, and control billing.
| Method | Endpoint | Description |
|--------|----------|-------------|
| `POST` | `/api/v1/organizations` | Create a new organization |
| `GET` | `/api/v1/organizations/{id}` | Get organization details |
| `PUT` | `/api/v1/organizations/{id}` | Update organization settings |
| `DELETE` | `/api/v1/organizations/{id}` | Delete an organization |
| `GET` | `/api/v1/organizations/{id}/api-keys` | List organization API keys |
| `GET` | `/api/v1/organizations/{id}/remote-config` | Get remote config for the org |
| `GET` | `/api/v1/organizations/{orgId}/metrics` | Get organization usage metrics |
---
## Organization Members
Manage who has access to the organization and what role they hold.
| Method | Endpoint | Description |
|--------|----------|-------------|
| `GET` | `/api/v1/organizations/{orgId}/members` | List all members |
| `DELETE` | `/api/v1/organizations/{orgId}/members` | Remove members |
| `GET` | `/api/v1/organizations/{orgId}/members/available-roles` | List assignable roles |
| `PUT` | `/api/v1/organizations/{orgId}/members/{memberId}/role` | Change a member's role |
| `GET` | `/api/v1/organizations/{orgId}/members/{memberId}/usages` | Get a member's usage |
<Tip>
For a walkthrough of member management in the UI, see [Managing Members](/enterprise-solutions/team-management/managing-members).
</Tip>
---
## Organization Invites
Invite new members to join your organization.
| Method | Endpoint | Description |
|--------|----------|-------------|
| `GET` | `/api/v1/organizations/{orgId}/invites` | List pending invites |
| `POST` | `/api/v1/organizations/{orgId}/invites` | Send new invites |
| `GET` | `/api/v1/organizations/{orgId}/invites/count` | Get invite count |
| `DELETE` | `/api/v1/organizations/{orgId}/invites/{inviteId}` | Revoke an invite |
| `POST` | `/api/v1/invites/accept` | Accept an invite (called by the invitee) |
---
## Organization Balance and Payments
Manage credits and payments at the organization level. These mirror the user-level payment endpoints but operate on the organization's account.
| Method | Endpoint | Description |
|--------|----------|-------------|
| `GET` | `/api/v1/organizations/{orgId}/balance` | Get org credit balance |
| `GET` | `/api/v1/organizations/{orgId}/payments` | List payment history |
| `GET` | `/api/v1/organizations/{orgId}/payments/{paymentId}` | Get payment details |
| `GET` | `/api/v1/organizations/{orgId}/payments/{paymentId}/status` | Check payment status |
| `GET` | `/api/v1/organizations/{orgId}/payments/provider/{paymentId}` | Provider-side payment details |
| `POST` | `/api/v1/organizations/{orgId}/credits/checkout` | Start credit checkout |
| `POST` | `/api/v1/organizations/{orgId}/credits/purchase` | Purchase credits |
| `GET` | `/api/v1/organizations/{orgId}/auto-top-up` | Get auto top-up config |
| `PUT` | `/api/v1/organizations/{orgId}/auto-top-up` | Configure auto top-up |
| `GET` | `/api/v1/organizations/{orgId}/payment-method/default` | Get default payment method |
| `POST` | `/api/v1/organizations/{orgId}/payment-method/setup-session` | Start payment method setup |
| `GET` | `/api/v1/organizations/{id}/promotions` | List active promotions |
---
## Organization Plans
Subscribe to, upgrade, or cancel plans. Manage seat counts for your team.
| Method | Endpoint | Description |
|--------|----------|-------------|
| `GET` | `/api/v1/plans` | List all available plans |
| `GET` | `/api/v1/organizations/{orgId}/plan` | Get current plan |
| `GET` | `/api/v1/organizations/{orgId}/plan/history` | View plan change history |
| `GET` | `/api/v1/organizations/{orgId}/plan/{planId}` | Get specific plan details |
| `POST` | `/api/v1/organizations/{orgId}/plan` | Subscribe to a plan |
| `PUT` | `/api/v1/organizations/{orgId}/plan/seats` | Update seat count |
| `DELETE` | `/api/v1/organizations/{orgId}/plan/{planId}` | Cancel a plan |
---
## Organization Usage
Track token consumption and costs across your organization.
| Method | Endpoint | Description |
|--------|----------|-------------|
| `GET` | `/api/v1/organizations/{orgId}/usages` | Get aggregated usage data |
<Tip>
For dashboards and monitoring, see [Monitoring Overview](/enterprise-solutions/monitoring/overview) and [Telemetry](/enterprise-solutions/monitoring/telemetry).
</Tip>
---
## API Keys
Create and manage API keys for programmatic access. Keys created here work with both the [Chat Completions API](/api/overview) and the endpoints on this page.
| Method | Endpoint | Description |
|--------|----------|-------------|
| `GET` | `/api/v1/api-keys` | List your API keys |
| `POST` | `/api/v1/api-keys` | Create a new API key |
| `DELETE` | `/api/v1/api-keys/{key_id}` | Delete an API key |
---
## Related
<CardGroup cols={2}>
<Card title="Chat Completions API" icon="code" href="/api/overview">
The public inference API for sending prompts and receiving completions.
</Card>
<Card title="SSO Setup" icon="key" href="/enterprise-solutions/sso-setup">
Configure single sign-on for your organization.
</Card>
<Card title="Managing Members" icon="users" href="/enterprise-solutions/team-management/managing-members">
Add, remove, and manage member roles in the UI.
</Card>
<Card title="Monitoring" icon="chart-line" href="/enterprise-solutions/monitoring/overview">
Track usage, costs, and telemetry across your organization.
</Card>
</CardGroup>