EN ▾

Chinese LLM APITranslation

Get API key

Updated

OpenAI Compatible API URL: Base URL and Headers

The base URL is https://api.chinesellmapi.com/v1. Put it where your OpenAI client expects a base URL, add your key as a Bearer token, and use the model ID uncensored.

A cable linking a laptop terminal to a glowing server cube, representing connecting a client to an API endpoint

The short answer

If you are looking for an openai compatible api url for this service, copy this value:

https://api.chinesellmapi.com/v1

That is the base URL. Every OpenAI SDK, desktop client and agent framework that has a field called "base URL", "API base", "endpoint" or "host" takes this string. The key goes in the matching "API key" field, and the model name is uncensored.

Two endpoints exist behind it: POST /v1/chat/completions for chat and GET /v1/models to list models. Nothing else from the OpenAI surface is offered, so there is no embeddings route, no image route and no fine-tuning route. If you need a key first, the API key page walks you through sign-up.

Base URL versus full endpoint URL

Most mistakes happen here. Clients fall into two groups: those that want the base URL and add the path themselves, and those that want the complete URL of the call. The table shows both forms.

What the field asks forValue to enter
Base URL, API base, OpenAI hosthttps://api.chinesellmapi.com/v1
Full chat completions URLhttps://api.chinesellmapi.com/v1/chat/completions
Models list URLhttps://api.chinesellmapi.com/v1/models

The official OpenAI SDKs, LangChain's OpenAI wrapper, LiteLLM and most chat front ends belong to the first group. Tools that let you paste a raw request URL belong to the second. When a field label does not say which one it is, read the placeholder text: if it shows something ending in /v1, it wants the base URL.

Trailing slashes

Most SDKs handle a trailing slash, but some build the final path by plain string joining. If you get a 404 and the URL ends with /v1/, remove the last slash and try again.

Headers the API expects

Requests need one header for authentication and one for the body type:

  • Authorization: Bearer YOUR_KEY
  • Content-Type: application/json

The SDKs set both for you. If you build requests by hand, here is the smallest working call:

curl https://api.chinesellmapi.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Say hello in one sentence."}]
  }'

The response carries a few headers worth logging: X-Request-Id for support questions, X-Balance-USD for the remaining credit, and X-RateLimit-Limit-Requests and X-RateLimit-Limit-Concurrency for the limits that apply to your key.

Setting it in the OpenAI SDKs

Only two values change compared with a stock OpenAI setup: the base URL and the key. Everything else in your code stays as it is.

Python

from openai import OpenAI

client = OpenAI(
    base_url="https://api.chinesellmapi.com/v1",
    api_key="YOUR_KEY",
)

resp = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Translate 'good morning' into Chinese."}],
)
print(resp.choices[0].message.content)

Node

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.chinesellmapi.com/v1",
  apiKey: process.env.API_KEY,
});

const resp = await client.chat.completions.create({
  model: "uncensored",
  messages: [{ role: "user", content: "Translate 'good morning' into Chinese." }],
});
console.log(resp.choices[0].message.content);

Streaming works the same way: add stream: true and read the chunks. Usage figures arrive at the end of the stream. Keep in mind that a streamed request holds one of your concurrency slots until the stream closes.

Environment variables instead of code

The current OpenAI SDKs for Python and Node read OPENAI_BASE_URL and OPENAI_API_KEY from the environment when you do not pass them in code. That is the quickest way to point an existing project at a new endpoint without touching a line:

export OPENAI_BASE_URL="https://api.chinesellmapi.com/v1"
export OPENAI_API_KEY="YOUR_KEY"
python app.py

Many third-party tools use the same two variable names, though some use their own, such as API_BASE or OPENAI_API_BASE in older projects. Check the tool's docs for the exact name. If a project hard-codes api.openai.com somewhere, search the source for that hostname and replace it.

The model name usually lives in a separate setting, so remember to change it to uncensored too. Leaving a default OpenAI model name in place is the second most common reason for an error after a wrong URL.

Check the connection before debugging your app

Test the URL and key with a call that costs nothing. Listing models needs no tokens:

curl https://api.chinesellmapi.com/v1/models \
  -H "Authorization: Bearer YOUR_KEY"

If this returns a JSON list that includes uncensored, the URL and key are fine and any remaining problem sits in your client's settings. If it fails, use this table.

SymptomLikely causeFix
404 Not FoundPath doubled (/v1/v1/...) or /v1 missingEnter the base URL exactly once, ending in /v1
401 UnauthorizedKey missing, copied with a space, or sent in the wrong headerSend Authorization: Bearer YOUR_KEY and re-copy the key
429 with code rate_limitedToo many requests per minuteSlow down or queue requests
429 with code concurrencyToo many requests at the same momentCap parallel calls, remember streams hold a slot
429 with Retry-After: 5Temporary overloadWait the five seconds and retry
Model not foundA leftover OpenAI model nameSet the model to uncensored

Limits you should know before you point production at it

A full key allows 8 concurrent requests and 300 requests per minute. The trial key allows 2 concurrent requests and 60 per minute. The request body can be up to 8 MB, and the context window is 100,000 tokens, prompt and completion together, so max_tokens is optional.

The service is text only and runs a single open-weight model from an independent provider. It is not the official API of any model vendor and it does not route between vendors. If your app is a Chinese-language product, the Chinese-language app quickstart shows how to structure prompts, and the translation API guide covers glossaries and placeholders.

Billing is pay as you go from prepaid credit: $0.15 per 1M input tokens and $0.50 per 1M output tokens. Failed or refused requests are not charged. The pricing page lists top-up sizes and bonuses, and new users can claim $0.50 of trial credit with one click on the key page, valid for 7 days and without a card. For a longer walkthrough of client setup, see the quickstart docs.

Content that sexualises minors is never allowed; apart from that, the model is tuned to answer without content refusals for lawful adult use.

Other places the URL goes

Frameworks name the field differently, but the value is the same. Three common examples:

# LangChain
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
    base_url="https://api.chinesellmapi.com/v1",
    api_key="YOUR_KEY",
    model="uncensored",
)

# LiteLLM
import litellm
r = litellm.completion(
    model="openai/uncensored",
    api_base="https://api.chinesellmapi.com/v1",
    api_key="YOUR_KEY",
    messages=[{"role": "user", "content": "ping"}],
)

In LiteLLM the openai/ prefix tells the library to use the OpenAI wire format against your own base URL, and the part after the slash is the model ID. Chat front ends such as SillyTavern have a "custom OpenAI-compatible" source with three boxes: URL, key and model. Same three values again.

Keep the key off the browser

Do not call the API from front-end JavaScript that ships to visitors. Anyone can read the key from the page and spend your credit. Put a small server route in between, store the key in an environment variable there, and let your site call that route.

Switching between endpoints without code changes

If you test several providers, put the three values in config rather than in source. A tiny settings block does the job and makes the URL the only thing you edit:

import os
from openai import OpenAI

client = OpenAI(
    base_url=os.getenv("LLM_BASE_URL", "https://api.chinesellmapi.com/v1"),
    api_key=os.environ["LLM_API_KEY"],
)
MODEL = os.getenv("LLM_MODEL", "uncensored")

This also makes staging and production easy to separate: use a different key per environment, and the X-Balance-USD response header will show each one's remaining credit.

Questions and answers

Do I include /chat/completions in the base URL?

No. Enter https://api.chinesellmapi.com/v1 and let the SDK append /chat/completions. Only tools that ask for a full request URL need the longer form.

Can I use the same URL for several apps?

Yes. The URL and key can go into any number of clients. They share your key's limits: 8 concurrent requests and 300 requests per minute on a full key.

What model name do I enter?

Use uncensored. You can confirm it by calling GET /v1/models with your key.

Is this the official API of an OpenAI-style vendor?

No. It is a hosted API for one open-weight model run by an independent provider, built to be compatible with the OpenAI request format.

How do I test the key without spending credit?

Call GET /v1/models with the Authorization header. It returns the model list and does not use tokens.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key