API gateway

Agent use vs external calling
Start and connect
Use case: Let a local script call the model
Configuration
Suggested starting point
Effect
Notes
Completion criteria
Safe operations
Last updated
Was this helpful?
The API gateway provides the model capabilities configured in Cherry Studio to local programs through an OpenAI- and Anthropic-compatible HTTP API. It is also an internal service required for Agent operation.
Path: [Settings] → [API Gateway].

Use only Cherry Studio Agent: just follow the app prompt [Enable and Start]; you do not need to copy the URL or key to other programs;
For local programs that need to call Cherry Studio: start the gateway, copy the URL and API key, and choose a compatible interface according to the API documentation;
To allow other devices to access it: this will expand the exposure scope; you need to verify network listening, firewalls, and access control yourself; it is not recommended to open it without security measures.
First confirm in [Settings] → [Model Service] that the model can chat normally, then start the API gateway. The script only saves the local gateway address and key, first request the model list, then send a short sentence. Before integrating the full program, confirm that the client supports an OpenAI- or Anthropic-compatible interface.
Listening scope
Local only
Reduce network exposure
Do not directly open it to the LAN or public Internet just for convenience in debugging
API key
Store separately for the current gateway
Verify client requests
Do not write into repositories, screenshots, or shared logs
Verify requests
First check the model list and short text
Verify connection and generation separately
When it fails, record the status code, not the full key
The gateway shows [Running]; the model list can be read; the short text request succeeds; after stopping the gateway, the client can no longer continue calling.
The API key can call the model services you configured in Cherry Studio. If the key is leaked, first stop the gateway, then click [Regenerate] while stopped, and update all local clients.
When the gateway is running, the port and key remain read-only; stop it before making changes;
Do not display the key in public repositories, Issues, logs, or tutorial screenshots;
Only save the key for programs that need to call it;
Usage and charges are still generated by the actual model provider; you can view Cherry Studio records under [Settings] → [Usage Statistics].
Last updated
Was this helpful?
Was this helpful?