Notice: Kling 4.0 is here: text-to-video and image-to-video are 20% off for a limited time. Try it now
HiAPI
Tutorials
On this page

Cherry Studio

Add a HiAPI custom provider in Cherry Studio, fill the three endpoints according to each model's protocol, and use Claude, GPT and DeepSeek through HiAPI.

Cherry Studio can connect to HiAPI through a custom provider. One provider can hold three endpoints at once — OpenAI, Anthropic and OpenAI Responses — each for a different protocol, and you pick the endpoint that matches the protocol a model supports. The steps below use claude-opus-5-5, gpt-6-astra and deepseek-v4.1-flash as examples; this tutorial was verified on Cherry Studio 2.1.7.

1. Prepare a HiAPI API key

Prepare a key as described in Get an API Key, click the copy icon next to the key, and copy the full HiAPI API key to fill into Cherry Studio below.

2. Choose the protocol

ProtocolEndpoint in Cherry StudioSuitable models
Anthropic MessagesAnthropic endpointClaude series
OpenAI Chat CompletionsOpenAI endpointMost models, such as GPT and DeepSeek
OpenAI ResponsesOpenAI Responses endpointModels that need Responses features

The example models on this page have all been tested with the table above. For another model, choose the endpoint from the table first and send a message to try it; if you get 400 does not support this endpoint, switch to another endpoint.

3. Add the provider

3.1 Where to start

Click Settings → Model Providers → Add Provider (设置 → 模型服务 → 添加提供商).

Add provider entry

Add a custom provider

3.2 Fill the same address into all three endpoints

FieldValue
Provider nameHiAPI
API keyyour HiAPI API key
Endpoint settings → OpenAIhttps://api.hiapi.ai
Endpoint settings → Anthropichttps://api.hiapi.ai
More settings → OpenAI Responseshttps://api.hiapi.ai

Fill https://api.hiapi.ai into all three endpoints without /v1; Cherry Studio appends the path itself. This differs from other tools.

3.3 Check the actual request paths

EndpointShould show
OpenAIhttps://api.hiapi.ai/v1/chat/completions
Anthropichttps://api.hiapi.ai/v1/messages
OpenAI Responseshttps://api.hiapi.ai/v1/responses

If they don’t match: when you see /v1/v1/..., change the field to https://api.hiapi.ai; when /v1 is missing, change it to https://api.hiapi.ai/v1.

Check the request paths

4. Add models and set their protocol

After adding a model name, click the model’s pencil icon to open Edit Model (编辑模型), choose the Chat protocol (对话协议) that matches the model’s protocol, and set Max output tokens (最大输出 Token).

SettingHow to fill
Chat protocolChoose according to the model: Anthropic / OpenAI / OpenAI Responses
Max output tokensRequired; 8192 is recommended (must not exceed the model limit); if left empty, an empty value is sent and you get 400 max_tokens: ""
Context lengthFill according to the model
Model capabilitiesTick Tools (工具) if you need tool calling

4.1 Protocol examples

Using the three models below, first add the model names:

TEXT
claude-opus-5-5
gpt-6-astra
deepseek-v4.1-flash

Then click a model’s pencil icon → Edit Model (编辑模型) and choose the chat protocol as follows:

ModelChoose in Cherry Studio
claude-opus-5-5Anthropic
gpt-6-astraOpenAI (OpenAI Responses also works)
deepseek-v4.1-flashOpenAI

Edit model configuration

5. Verify

After changing settings, start a new chat to test; old chats cache the parameters.

5.1 Chat

Start a new chat and send “Hello, introduce yourself in one sentence.” with each configured model; a normal reply means the connection works.

Verify with a chat

5.2 Tool calling

Configure MCP as described in the Cherry Studio section of the MCP setup guide (a built-in server or one installed from the marketplace), then create tool-call-test.txt in a folder MCP is allowed to access, write one line hello hiapi and save it. Then send “Only use the file reading tool once. Read the entire contents of tool-call-test.txt and return them exactly as they are. Do not modify the file, do not read any other files, and do not guess the contents from the file name.” A tool call appears and returns hello hiapi.

Verify tool calling

6. Troubleshooting

Only issues specific to Cherry Studio are listed here. For common errors such as 401, 404 and 429, see Common errors.

ErrorCauseFix
400 max_tokens: ""Max output tokens is not setSet it to 8192
max_completion_tokens exceeds 64000The default value is above the limitLower it to below 64000
400 stream: must be trueThe Check Model (检测模型) button sends a non-streaming requestGo by an actual chat and keep streaming on
net::ERR_NETWORK_CHANGEDNetwork or proxy flappingRetry or turn off the proxy
400 does not support this endpointThe chat protocol does not match the modelChoose Anthropic for Claude; choose OpenAI or OpenAI Responses for gpt-6-astra
A custom endpoint returns an empty max_tokensYou are using the Claude Agent run modeDo not use Claude Agent mode with a custom endpoint