Prerequisites
- A Cline account at app.cline.bot
curlor any HTTP client (Python, Node.js, etc.)
Create an API Key
Sign in to app.cline.bot
Go to app.cline.bot and sign in with your account.
Make Your First Request
ReplaceYOUR_API_KEY with the key you just created:
Verify the Response
You should get a JSON response like this:choices[0].message.content field contains the model’s reply. The usage field shows how many tokens were consumed.
Try Streaming
For real-time output, setstream: true. The response arrives as Server-Sent Events:
data: line. The stream ends with data: [DONE].
Try a Free Model
To test without spending credits, use one of the free models:Troubleshooting
| Problem | Solution |
|---|---|
401 Unauthorized | Check that your API key is correct and included in the Authorization header |
402 Payment Required | Your account has insufficient credits. Add credits at app.cline.bot |
| Empty response | Make sure messages is a non-empty array with at least one user message |
| Connection timeout | Verify your network can reach api.cline.bot. Check proxy settings if on a corporate network |

