How to Connect a Desktop AI Client to a Third-Party API
This guide explains how to connect a desktop AI client to a third-party API without signing in to an official account. By enabling Developer mode and configuring a third-party inference gateway, you can inject a custom API base URL, API key, and model list into the client. The article covers prerequisites, step-by-step setup, multi-profile switching, the advantages of desktop clients, and best practices for key security and OpenAI-compatible formatting.
1. Why Connect a Third-Party API on Desktop
In AI application development and everyday office work, many desktop AI clients only support their official API protocol format by default. This creates two common pain points:
- Format lock-in: The client only recognizes its own protocol and cannot directly connect to OpenAI-compatible endpoints offered by other vendors or self-hosted services.
- Account dependency: Some desktop apps require you to sign in to an official account, which is not suitable for enterprise intranets or privacy-sensitive environments.
By enabling Developer mode and configuring a third-party inference gateway, you can inject a custom API address, key, and model list into the client without signing in to an official account. This enables a flexible “local desktop shell + remote model of choice” architecture.
2. Prerequisites
| Item | Description |
|---|---|
| Desktop client | Download and install the latest version from the official source |
| Third-party API | A usable Base URL and API Key |
| Permissions | Local administrator rights (required to enable Developer mode) |
Note: The entry point varies slightly by operating system. On Mac, you typically use the top menu bar; on Windows, you click the menu button in the top-left corner of the window.
3. Enable Developer Mode
- Launch the client and do not sign in to any account yet.
- Open the top menu bar and navigate to:
- Mac:
Help → Troubleshooting → Enable Developer mode - Windows: Click the three horizontal lines in the top-left corner, then follow the same path.
- Mac:
- Once enabled, a new
Developeroption appears in the menu bar.
4. Configure the Third-Party Inference Gateway
Select Configure third-party inference from the Developer menu to open the configuration panel.
4.1 Core Parameters
Connection: Gateway # Fixed option; indicates a custom API is usedGateway base URL: https://your-api-endpoint.com/v1Gateway API key: sk-xxxxxxxxxxxxxxxx
4.2 Model List Configuration
At the bottom of the configuration panel, enter the names of the models you want to call. These names appear directly in the model selector in the client’s chat interface.
{"models": ["deepseek-chat","glm-4","gpt-4o"]}
4.3 Switching Between Multiple Profiles
If you need to manage multiple API sources at once (for example, different model providers or different project environments):
- Click the
defaultprofile (a green dot indicates the active one). - You can duplicate, rename, or create a profile.
- Each profile is stored as a separate JSON file that you can locate and edit directly.
An example structure looks like this:
{"activeProfile": "work","profiles": {"work": {"baseUrl": "https://internal-gateway.company.com/v1","apiKey": "sk-work-key","models": ["model-a", "model-b"]},"personal": {"baseUrl": "https://external-api.example.com/v1","apiKey": "sk-personal-key","models": ["model-c"]}}}
5. Differentiated Advantages of Desktop Clients
Compared with pure web clients, desktop clients offer clear value in these scenarios:
- In-depth document operations: They can read and edit local files directly, with no need to upload or download them manually.
- Scheduled tasks and background execution: They support automation such as scheduled tasks and event listeners.
- Local integration: They can call native capabilities such as the system clipboard, notification center, and file monitoring.
- Offline experience: The UI framework and basic interactions do not depend on the network, so responses feel smoother.
6. Notes and Best Practices
- Key security: The API Key is stored in plaintext in a local JSON configuration file. It is recommended to set strict file system permissions on the configuration file to prevent leaks.
- Format compatibility: The client only accepts OpenAI-compatible format. If a third-party service returns a different format, you need to perform protocol conversion at the gateway layer.
- Version update risk: Developer mode is an unofficial feature, so the entry path or configuration format may change after a client upgrade.
- Baidu AI Cloud practices: If you use model services from Baidu AI Cloud, it is recommended to obtain the Base URL and authentication details through its official API gateway, and to handle rate limiting and logging at the gateway layer for easier monitoring and billing management.
7. Summary
With the combination of Developer mode and gateway configuration, you can connect a desktop AI client to any inference service that is compatible with the OpenAI protocol without signing in to an account. The key is to understand the roles of the four core parameters—Connection, Base URL, API Key, and models—and to make good use of multi-profile switching to manage different environments. For teams that need deep local integration, document processing, and automation, desktop clients still offer irreplaceable practical value.
