Other OpenAI-compatible clients
Common settings for Cherry Studio, Chatbox, SDKs and other clients with a custom base URL.
Any app, extension or SDK that lets you set a custom OpenAI address works with this site. Apps differ in how they want the address, so here are the general rules and the settings for common clients.
General rules
| The app asks for | Enter |
|---|---|
API address / API host / base URL (the app adds /v1 itself) | https://tokenfunc.com |
Base URL (the app does not add /v1; most SDKs) | https://tokenfunc.com/v1 |
| The full endpoint | https://tokenfunc.com/v1/chat/completions |
When unsure, try https://tokenfunc.com/v1 first and switch to https://tokenfunc.com if you get 404. Many apps preview the final request URL in their settings; it should read https://tokenfunc.com/v1/chat/completions.
Cherry Studio
Add a provider
Open Settings → Model Provider, click + Add Provider at the bottom of the list, and enter a name and the API key
sk-xxxxxxxxxxxxxxxx.Fill in the endpoint
Enter
https://tokenfunc.comin the OpenAI endpoint field. Cherry Studio adds/v1itself and previews the final request path below the field so you can check it. For the full Claude feature set, also enterhttps://tokenfunc.comin the Anthropic field.Screenshot pendingCherry Studio's Add Provider window with the endpoint and the request path previewtools/cherry-studio-provider.png
Add models and check
Click Fetch model list and add the models you want (or add
gpt-5by hand). Then click Check, test a model, and turn on the provider switch at the top right.
Chatbox
Add a model provider
Open Settings → Model Provider, click Add, enter a name and set API Mode to OpenAI API Compatible.
Enter the host and key
Field Value API Key sk-xxxxxxxxxxxxxxxxAPI Host https://tokenfunc.comAPI Path Leave empty With API Path empty, Chatbox appends
/v1/chat/completions. If you fill in API Path, the host must include/v1itself.In Claude API Compatible mode, the API host must be
https://tokenfunc.com/v1.Add models and check
In the models section click Fetch to load the list, or New to add
gpt-5by hand, then save and click Check.
In your own code
Every OpenAI SDK accepts a custom base URL, with /v1:
Python
from openai import OpenAI
client = OpenAI(base_url="https://tokenfunc.com/v1", api_key="sk-xxxxxxxxxxxxxxxx")Node.js
import OpenAI from 'openai'
const client = new OpenAI({ baseURL: 'https://tokenfunc.com/v1', apiKey: 'sk-xxxxxxxxxxxxxxxx' })Environment variables
# Most tools built on the OpenAI SDK read these two variables
export OPENAI_BASE_URL="https://tokenfunc.com/v1"
export OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxx"The OpenAI components in LangChain, LlamaIndex and similar frameworks take the same base_url and api_key. More patterns are in Chat Completions.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| 404 | One /v1 too many or too few. Adjust using the rules above |
| The fetched model list is empty | The key's group has no models, or the key limits its models |
| 401 | Wrong key or no quota left. Check it on API Keys |