Tämä opas on päivitetty, ja se on toistaiseksi saatavilla vain englanniksi.
Use JuiceFactory in Cursor with your own API key
Cursor lets you add your own API key and send OpenAI-compatible requests to another endpoint. This guide connects Cursor to JuiceFactory so that Ask and Plan mode run on qwen3.8-27b, an open-weight Qwen model on JuiceFactory's own hardware in Sweden. It also covers what the setup does not change: Cursor still routes every request through its own servers, and Agent mode and Tab completion keep using Cursor's own models.
What you need
- A JuiceFactory account. New verified accounts get starter credit for up to 100 standard API requests; no payment card is needed for that test.
- An API key from the portal. Keys look like
pk_live_…. - Cursor, with access to Cursor Settings → Models.
Step 1: check that your key works
curl https://api.juicefactory.ai/v1/chat/completions \
-H "Authorization: Bearer $JUICEFACTORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "qwen3.8-27b", "messages": [{"role": "user", "content": "Say OK."}]}'
A JSON response with a choices array means the key and the model work.
Step 2: connect Cursor
- Open Cursor Settings → Models and go to API Keys.
- Paste your JuiceFactory key into the OpenAI API Key field.
- Turn on Override OpenAI Base URL and enter
https://api.juicefactory.ai/v1. - Add a custom model named
qwen3.8-27band choose it in the chat.
Cursor moves settings between versions. If a field is not where this guide says, look for the OpenAI API key and base URL settings under Models.
What works and what does not
| Cursor feature | With your JuiceFactory key |
|---|---|
| Ask and Plan mode (chat) | Runs on qwen3.8-27b |
| Agent mode | Uses Cursor's own models |
| Tab completion | Uses Cursor's own models |
Cursor's documentation states that custom API keys only work with chat models and that Tab completion keeps using Cursor's built-in models. While the base URL override is on, Cursor can also send requests for its own models to that URL; turn the override off if Cursor's built-in models start returning errors.
Where your code goes
Cursor's documentation states that every request, also with your own key, is routed through Cursor's servers for final prompt building before it reaches the model provider. With this setup your prompts and code therefore pass Cursor's infrastructure on the way to JuiceFactory. JuiceFactory processes them in Sweden and does not store them or train on them, but the path as a whole is not EU-only.
If your code must not leave the EU, use an editor extension that lets you set an OpenAI-compatible base URL and sends requests from your machine directly to https://api.juicefactory.ai/v1.
Cost
qwen3.8-27b costs €1.00 per million input tokens and €2.50 per million output tokens, excluding VAT, drawn from prepaid credits. A chat question with 2,000 tokens of code as context and a 500-token answer costs about €0.003. The current list is at GET /v1/models.
Troubleshooting
- 401 Invalid API key: the key is wrong or revoked. Create a new one in the portal.
- 404 Model not found: the model name must be exactly
qwen3.8-27b. The error lists the available models. The older namesqwen3.5-27bandqwen3-27bstill reach the same model. - 402: the account is out of credit. Add credits in the portal.
- Cursor's built-in models fail: turn off Override OpenAI Base URL while you use them.
Questions about data processing or larger volumes: legal@juicefactory.ai.