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 forEnter
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 endpointhttps://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

  1. 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.

  2. Fill in the endpoint

    Enter https://tokenfunc.com in the OpenAI endpoint field. Cherry Studio adds /v1 itself and previews the final request path below the field so you can check it. For the full Claude feature set, also enter https://tokenfunc.com in the Anthropic field.

    Screenshot pendingCherry Studio's Add Provider window with the endpoint and the request path previewtools/cherry-studio-provider.png

  3. Add models and check

    Click Fetch model list and add the models you want (or add gpt-5 by hand). Then click Check, test a model, and turn on the provider switch at the top right.

Chatbox

  1. Add a model provider

    Open Settings → Model Provider, click Add, enter a name and set API Mode to OpenAI API Compatible.

  2. Enter the host and key

    FieldValue
    API Keysk-xxxxxxxxxxxxxxxx
    API Hosthttps://tokenfunc.com
    API PathLeave empty

    With API Path empty, Chatbox appends /v1/chat/completions. If you fill in API Path, the host must include /v1 itself.

    In Claude API Compatible mode, the API host must be https://tokenfunc.com/v1.

  3. Add models and check

    In the models section click Fetch to load the list, or New to add gpt-5 by 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

SymptomCause and fix
404One /v1 too many or too few. Adjust using the rules above
The fetched model list is emptyThe key's group has no models, or the key limits its models
401Wrong key or no quota left. Check it on API Keys