Back to Cline

Enterprise API Reference

docs/enterprise-solutions/api-reference.mdx

3.82.08.0 KB
Original Source

The Enterprise API provides REST endpoints for account management, organization administration, billing, and API key management. These are separate from the Chat Completions API, 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.

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": "[email protected]",
  "name": "Your Name",
  "active_account_id": "org_xyz789"
}

Users

Manage user accounts, accept terms, check balances, view usage, and configure payment methods.

MethodEndpointDescription
GET/api/v1/users/meGet current user profile
PATCH/api/v1/users/meUpdate current user profile
DELETE/api/v1/users/meDelete current user account
POST/api/v1/users/me/accept-termsAccept terms of service
GET/api/v1/users/me/remote-configGet remote configuration for the current user
PUT/api/v1/users/active-accountSwitch active account (personal or organization)
GET/api/v1/users/{id}/balanceGet credit balance
GET/api/v1/users/{id}/usagesGet usage history

Payments and Credits

MethodEndpointDescription
GET/api/v1/users/{id}/paymentsList payment history
GET/api/v1/users/{id}/payments/{paymentId}Get payment details
GET/api/v1/users/{id}/payments/{paymentId}/statusCheck payment status
GET/api/v1/users/{id}/payments/provider/{paymentId}Get provider-side payment details
POST/api/v1/users/credits/checkoutStart a credit purchase checkout
POST/api/v1/users/{id}/credits/purchasePurchase credits directly

Billing Configuration

MethodEndpointDescription
GET/api/v1/users/{id}/auto-top-upGet auto top-up settings
PUT/api/v1/users/{id}/auto-top-upConfigure auto top-up
GET/api/v1/users/{id}/payment-method/defaultGet default payment method
POST/api/v1/users/{id}/payment-method/setup-sessionStart payment method setup
GET/api/v1/users/{id}/promotionsList active promotions

Organizations

Create and manage organizations. Organization admins can configure remote settings, manage members, and control billing.

MethodEndpointDescription
POST/api/v1/organizationsCreate 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-keysList organization API keys
GET/api/v1/organizations/{id}/remote-configGet remote config for the org
GET/api/v1/organizations/{orgId}/metricsGet organization usage metrics

Organization Members

Manage who has access to the organization and what role they hold.

MethodEndpointDescription
GET/api/v1/organizations/{orgId}/membersList all members
DELETE/api/v1/organizations/{orgId}/membersRemove members
GET/api/v1/organizations/{orgId}/members/available-rolesList assignable roles
PUT/api/v1/organizations/{orgId}/members/{memberId}/roleChange a member's role
GET/api/v1/organizations/{orgId}/members/{memberId}/usagesGet 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.

MethodEndpointDescription
GET/api/v1/organizations/{orgId}/invitesList pending invites
POST/api/v1/organizations/{orgId}/invitesSend new invites
GET/api/v1/organizations/{orgId}/invites/countGet invite count
DELETE/api/v1/organizations/{orgId}/invites/{inviteId}Revoke an invite
POST/api/v1/invites/acceptAccept 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.

MethodEndpointDescription
GET/api/v1/organizations/{orgId}/balanceGet org credit balance
GET/api/v1/organizations/{orgId}/paymentsList payment history
GET/api/v1/organizations/{orgId}/payments/{paymentId}Get payment details
GET/api/v1/organizations/{orgId}/payments/{paymentId}/statusCheck payment status
GET/api/v1/organizations/{orgId}/payments/provider/{paymentId}Provider-side payment details
POST/api/v1/organizations/{orgId}/credits/checkoutStart credit checkout
POST/api/v1/organizations/{orgId}/credits/purchasePurchase credits
GET/api/v1/organizations/{orgId}/auto-top-upGet auto top-up config
PUT/api/v1/organizations/{orgId}/auto-top-upConfigure auto top-up
GET/api/v1/organizations/{orgId}/payment-method/defaultGet default payment method
POST/api/v1/organizations/{orgId}/payment-method/setup-sessionStart payment method setup
GET/api/v1/organizations/{id}/promotionsList active promotions

Organization Plans

Subscribe to, upgrade, or cancel plans. Manage seat counts for your team.

MethodEndpointDescription
GET/api/v1/plansList all available plans
GET/api/v1/organizations/{orgId}/planGet current plan
GET/api/v1/organizations/{orgId}/plan/historyView plan change history
GET/api/v1/organizations/{orgId}/plan/{planId}Get specific plan details
POST/api/v1/organizations/{orgId}/planSubscribe to a plan
PUT/api/v1/organizations/{orgId}/plan/seatsUpdate seat count
DELETE/api/v1/organizations/{orgId}/plan/{planId}Cancel a plan

Organization Usage

Track token consumption and costs across your organization.

MethodEndpointDescription
GET/api/v1/organizations/{orgId}/usagesGet 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 and the endpoints on this page.

MethodEndpointDescription
GET/api/v1/api-keysList your API keys
POST/api/v1/api-keysCreate a new API key
DELETE/api/v1/api-keys/{key_id}Delete an API key

<CardGroup cols={2}> <Card title="Chat Completions API" icon="code" href="/api/reference"> 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>