Cherry Studio
Cherry Studio is a free, open-source desktop chat client for Windows, macOS, and Linux. Each provider in Cherry Studio has a type, and every provider type can point at MirAPI. An OpenAI-type provider is the main path; use the Anthropic or Gemini type when you need that protocol’s semantics.
What you need
Section titled “What you need”| Element | Value |
|---|---|
| Base URL (OpenAI) | https://api.mirapi.ai/v1 |
| Base URL (Anthropic) | https://api.mirapi.ai |
| Base URL (Gemini) | https://api.mirapi.ai/v1beta |
| API key | Your MirAPI key (sk-...) |
| Model | deepseek-chat (from GET /v1/models) |
The same key works across all three provider types and every assistant in the app.
Configure
Section titled “Configure”- Open Settings → Model Services → Add.
- Choose the OpenAI provider type.
- Fill in:
Provider name: MirAPIAPI base URL: https://api.mirapi.ai/v1API key: sk-...- Add a model. In the provider’s model list, click Manage / Add model and enter the exact ID from the catalog:
deepseek-chat- Save and enable the provider.
Cherry Studio sends the key as Authorization: Bearer. MirAPI treats the scheme as case-insensitive and also accepts a bare key without it. Cherry Studio appends /chat/completions to the base URL, which is why the address must include /v1.
Verify with a message
Section titled “Verify with a message”Start a new assistant using the MirAPI provider and send:
Reply with exactly: connected to MirAPIExpect the exact phrase in the reply. If the call fails, keep the error message Cherry Studio shows. It ends with the MirAPI request ID, which support needs.
Protocol variants
Section titled “Protocol variants”Cherry Studio also ships Anthropic and Gemini provider types, and both work with MirAPI’s matching endpoints. Pick one when you want that protocol’s own features, for example Anthropic’s cache_control prompt caching.
Anthropic
Section titled “Anthropic”| Element | Value |
|---|---|
| Base URL | https://api.mirapi.ai (no /v1) |
| API key | Your MirAPI key (sk-...), sent as x-api-key |
The Anthropic type calls /v1/messages. Enter the bare base URL without /v1, because the client appends /v1/messages itself. MirAPI accepts the key as either x-api-key or Authorization: Bearer.
Gemini
Section titled “Gemini”| Element | Value |
|---|---|
| Base URL | https://api.mirapi.ai/v1beta |
| API key | Your MirAPI key (sk-...), sent as x-goog-api-key |
The Gemini type calls generateContent on /v1beta/models/{model}:generateContent. MirAPI accepts x-goog-api-key or a ?key= query parameter; the bare https://api.mirapi.ai is also accepted as a base URL.
Billing
Section titled “Billing”- Chat is billed per token: USD per 1M tokens, with separate input, output, and cache-read tiers. Reasoning tokens are billed as output, and cache reads cost less than plain input.
- MirAPI uses a prepaid USD balance with no subscription and no minimum, and the balance never expires.
- When the balance runs out, calls return 403. Top up and the same key works again immediately.
- Reconcile spend in the Platform billing log, with
GET /api/usage/tokenfor the account summary andGET /api/log/tokenfor per-request detail.
Troubleshooting
Section titled “Troubleshooting”- 401: the key is missing, malformed, or unknown. Check it and retry.
- 403: the key is valid but the request was rejected because the model is not in the key’s whitelist, the balance is exhausted, the quota is reached, or the caller’s IP is not allowlisted. Fix the cause and retry.
- 429: rate limited. MirAPI sends no
Retry-Afterheader, so back off with jitter (1s → 2s → 4s, capped around 30s). - 500: an upstream failure. Idempotent requests are safe to retry. MirAPI never silently swaps in another model, so the retry stays on the model you chose.
- Add models by their exact
GET /v1/modelsID. A typo returns an error; MirAPI does not fall back to another model.