mirror of
https://github.com/cline/cline.git
synced 2026-09-19 10:13:34 +08:00
* docs: fix SDK documentation accuracy and completeness - Fix setPermissionHandler API Reference to use correct async/return signature (was showing old callback pattern with (request, resolve) => void) - Remove non-existent PermissionResolver type from Exported Types table - Fix PermissionHandler type description to match actual signature - Add missing hooksDir option to ClineAgentOptions documentation - Fix newSession() example to use real model IDs - Replace developer personal path in Full Example with generic path - Use placeholder for version in initialize() example to avoid staleness - Expand Stop Reasons table and add note about current implementation - Add missing key exported types: AcpSessionStatus, AcpSessionState, RequestPermissionRequest/Response, PermissionOption, SessionUpdatePayload, SessionModelState, ModelInfo, TextContent/ImageContent/AudioContent, SetSessionMode/Model request/response types, TranslatedMessage * docs: improve SDK visibility and disambiguate from API code examples - Move SDK page higher in Cline CLI nav (after Installation, before Interactive Mode) - Add sidebarTitle 'SDK (Programmatic Use)' for clearer nav label - Rename api/sdk-examples to 'Code Examples' to avoid naming confusion with the Cline SDK - Update API overview card title to match * Apply suggestions from code review Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * docs: add ClientCapabilities, Error Handling, and BYO API key docs to SDK - Document clientCapabilities object and its effect on agent behavior - Add Error Handling section with all throwable errors per method - Expand BYO API key setup with concrete CLI auth examples * docs: fix duplicated Stop Reasons table rows from code review * docs: fix 3 accuracy issues found in source code audit - Fix protocolVersion: was '0.9.0' (fabricated), actually 1 (number) from @agentclientprotocol/sdk - Fix clientCapabilities: was claiming they change SDK behavior, but ClineAgent always uses standalone providers (capabilities only matter via AcpAgent stdio wrapper) - Fix permission options: remove reject_always (never sent by agent, only allow_once/allow_always/reject_once are used) * docs: clarify custom clineDir usage with CLI --config flag Address PR review feedback: the BYO auth section mentioned custom clineDir without showing how to target it from the CLI. Remove the vague reference and add explicit --config flag documentation with side-by-side SDK and CLI examples. * docs: remove misleading 'by default' qualifier from SDK BYO auth section --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
59 lines
2.3 KiB
Plaintext
59 lines
2.3 KiB
Plaintext
---
|
|
title: "Cline API"
|
|
sidebarTitle: "Overview"
|
|
description: "Programmatic access to AI models through an OpenAI-compatible Chat Completions API."
|
|
---
|
|
|
|
Welcome to the Cline API documentation. Use the same models that power the Cline extension and CLI from any language, framework, or tool that speaks the OpenAI format.
|
|
|
|
## What is the Cline API?
|
|
|
|
The Cline API is an OpenAI-compatible Chat Completions endpoint. You authenticate once with a Cline API key and get access to models from Anthropic, OpenAI, Google, and more through a single base URL. No need to manage separate keys for each provider.
|
|
|
|
```
|
|
Your App → Cline API (api.cline.bot) → Anthropic / OpenAI / Google / etc.
|
|
```
|
|
|
|
<CardGroup cols={2}>
|
|
<Card title="Getting Started" icon="rocket" href="/api/getting-started">
|
|
Create an API key and make your first request in under a minute.
|
|
</Card>
|
|
<Card title="Authentication" icon="key" href="/api/authentication">
|
|
API keys, account tokens, key rotation, and security best practices.
|
|
</Card>
|
|
<Card title="Chat Completions" icon="message" href="/api/chat-completions">
|
|
Full endpoint reference with request schemas, streaming, and tool calling.
|
|
</Card>
|
|
<Card title="Code Examples" icon="code" href="/api/sdk-examples">
|
|
Ready-to-copy examples for Python, Node.js, curl, and the Cline CLI.
|
|
</Card>
|
|
</CardGroup>
|
|
|
|
## Explore the Reference
|
|
|
|
<CardGroup cols={3}>
|
|
<Card title="Models" icon="brain" href="/api/models">
|
|
Browse available models, free tier options, reasoning support, and selection guidance.
|
|
</Card>
|
|
<Card title="Errors" icon="triangle-exclamation" href="/api/errors">
|
|
Error codes, mid-stream errors, retry strategies, and debugging tips.
|
|
</Card>
|
|
<Card title="Enterprise API" icon="building" href="/enterprise-solutions/api-reference">
|
|
Admin endpoints for managing users, organizations, billing, and API keys.
|
|
</Card>
|
|
</CardGroup>
|
|
|
|
## Quick Start
|
|
|
|
```bash
|
|
curl -X POST https://api.cline.bot/api/v1/chat/completions \
|
|
-H "Authorization: Bearer YOUR_API_KEY" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"model": "anthropic/claude-sonnet-4-6",
|
|
"messages": [{"role": "user", "content": "Hello!"}]
|
|
}'
|
|
```
|
|
|
|
Get your API key at [app.cline.bot](https://app.cline.bot) (Settings > API Keys), then follow the [Getting Started](/api/getting-started) guide.
|