EN ▾
Start now

One API LLM Gateway: Add an Uncensored Upstream

A one api llm gateway puts many model providers behind a single endpoint and key, and an OpenAI-compatible service like ours plugs in as one upstream. This guide shows the settings to use, how to configure One API style panels and LiteLLM, and how to handle limits and fallbacks.

Last updated

A glass junction box with many pipes in and one amber branch to a glowing endpoint, showing an LLM gateway upstream

Summary

  • Any gateway that accepts a custom OpenAI-compatible upstream can use this API with a base URL, key and model ID.
  • The model ID is uncensored; the base URL is https://api.oneapillm.com/v1.
  • Set concurrency to 8 and requests per minute to 300 for a full key, and handle 429 with retries.
  • A fallback to a different model can change behavior; decide that on purpose.

What a gateway does and why add this upstream

An LLM gateway is a small server between your apps and the model providers. Your apps talk to one URL with one set of keys. The gateway forwards each request to the right provider, counts usage, applies limits and can retry or reroute. Open-source examples include One API style panels with channels and tokens, and LiteLLM with its proxy and router.

People add an uncensored upstream to a gateway for a practical reason: some requests, such as fiction, roleplay or companion chat for adults, get refused by providers with strict content policies. Routing only those requests to a different upstream keeps the rest of the stack unchanged. The gateway handles the routing, and your apps still see a single OpenAI-style API.

The four values every gateway needs

SettingValue
TypeOpenAI or custom OpenAI-compatible
Base URLhttps://api.oneapillm.com/v1
KeyYour key from the API key page, sent as a Bearer token
Model IDuncensored

The service is OpenAI-compatible and supports POST /v1/chat/completions, POST /v1/responses and GET /v1/models. Chat completions is what almost every gateway uses. It is text only, so do not route image, audio or embedding calls to it. Its 100,000-token context window is shared by prompt and completion.

Before you touch the gateway, test the upstream directly so you know any later error comes from the gateway:

curl https://api.oneapillm.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "uncensored", "messages": [{"role": "user", "content": "Reply with ok."}]}'

One API style panels

In a One API style gateway you work through the admin panel.

  1. Create a new channel and choose the OpenAI type (or the custom type if your panel offers one).
  2. Enter the base URL. Panels differ on whether the field takes the host alone or includes /v1. If the first test fails with a not-found error, try the other form.
  3. Paste the key.
  4. List the model name uncensored as the model for this channel.
  5. Save, then use the panel's test button, and confirm with a real call through the gateway's own endpoint.

If you want your users to call a different name, such as creative, use the panel's model redirect or mapping feature so that name maps to uncensored at the upstream. Then set per-token permissions so only the accounts that should reach this channel can.

LiteLLM: config file and Python router

LiteLLM treats any OpenAI-compatible service as a provider with the openai/ prefix. A proxy configuration looks like this:

cat > config.yaml <<'EOF'
model_list:
  - model_name: uncensored
    litellm_params:
      model: openai/uncensored
      api_base: https://api.oneapillm.com/v1
      api_key: os.environ/ONEAPILLM_KEY
      max_parallel_requests: 8
      rpm: 300
EOF

export ONEAPILLM_KEY="your-key"
litellm --config config.yaml

Your apps now call the proxy and ask for uncensored. In code, without the proxy, you can use the same mapping through the SDK:

import os
from litellm import completion

resp = completion(
    model="openai/uncensored",
    api_base="https://api.oneapillm.com/v1",
    api_key=os.environ["ONEAPILLM_KEY"],
    messages=[{"role": "user", "content": "Say hello in six words."}],
)
print(resp.choices[0].message.content)

The prefix tells LiteLLM to use the OpenAI protocol, and the part after the slash is the model ID sent to the upstream. If you see "model not found" from the upstream, that part is the first thing to check.

Test the channel end to end

A channel that passes the panel's test button can still fail on real traffic. Run these four checks through the gateway's own address before you give the model name to users.

  1. Plain chat. One short request, one answer.
  2. Streaming. Send stream: true and confirm that chunks arrive as server-sent events and that the usage figures show up at the end. Some gateways buffer the whole stream before passing it on, which makes the app feel slow.
  3. Tools. If your apps use function calling, send a request with a tools array and check that tool_calls come back and that a role: "tool" follow-up works.
  4. JSON mode. Send response_format with {"type":"json_object"} and make sure the gateway does not strip it.
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.oneapillm.com/v1",
    api_key=os.environ["ONEAPILLM_KEY"],
)

stream = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Count from one to five."}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Run it first against the upstream directly, then change only the base URL to your gateway. If the output differs, the gateway is the cause.

Limits, retries and fallbacks

A full key allows 8 concurrent requests and 300 requests per minute. A trial key allows 2 and 60. Set the gateway's per-channel limits just under these numbers so the gateway queues requests instead of the upstream rejecting them. A streamed request holds its slot until the stream ends, so a stuck client counts against your 8.

When a limit is hit, the API returns HTTP 429 with the error code rate_limited (too many requests per minute) or concurrency (too many at once). A temporary overload also gives 429, with a Retry-After: 5 header. Configure the gateway to retry on 429 after that delay, with a small cap on attempts. Responses carry X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency, X-Request-Id and X-Balance-USD, which are handy to log.

Fallbacks need a decision, and a setting alone does not make it. If the uncensored upstream fails and the gateway sends the same prompt to a model with strict content rules, the user may get a refusal or a changed tone in the middle of a conversation. Often the better fallback for this traffic is a retry on the same upstream, or a clear error to the client. If you do add a second route, the LiteLLM router takes a fallback map:

import os
from litellm import Router

router = Router(
    model_list=[
        {
            "model_name": "uncensored",
            "litellm_params": {
                "model": "openai/uncensored",
                "api_base": "https://api.oneapillm.com/v1",
                "api_key": os.environ["ONEAPILLM_KEY"],
            },
        },
        {
            "model_name": "general",
            "litellm_params": {
                "model": "openai/" + os.environ["OTHER_MODEL"],
                "api_base": os.environ["OTHER_BASE_URL"],
                "api_key": os.environ["OTHER_KEY"],
            },
        },
    ],
    fallbacks=[{"uncensored": ["general"]}],
    num_retries=2,
)

Cost, balance and observability

The gateway can sum token counts, but the upstream bill is the source of truth. You pay $0.15 per 1M input tokens and $0.50 per 1M output tokens from prepaid credit. As an example, a gateway sending 20,000 requests of 1,500 tokens in and 400 out to this upstream counts 30M input tokens ($4.50) and 8M output tokens ($4.00), $8.50 in total. Failed or refused requests are not charged.

Check the balance with GET /v1/balance, the OpenAI-style GET /v1/dashboard/billing/credit_grants or the X-Balance-USD header, and alert when it gets low. Top-ups are any whole amount from $20 to $500 in crypto (USDT on TRC20 or USDC on Base), with bonuses of 5% from $50, 10% from $100 and 15% from $200. See the pricing page and the documentation for details, and the troubleshooting guide if a channel test fails.

One more point for operators: prompts sent through this API are not used for training, but your gateway logs may contain full prompts. Decide how long you keep them.

Common questions

What do I enter as the base URL in a gateway?

Use https://api.oneapillm.com/v1. Some panels want the host without /v1, so if the first test returns not found, try the other form.

What model name should the channel use?

uncensored. If your users call another name, map it to uncensored with the gateway's model redirect feature.

How do I stop the gateway from hitting the rate limit?

Cap parallel requests at 8 and requests per minute at 300 for a full key, or 2 and 60 for a trial key, and retry on HTTP 429 after the Retry-After delay.

Can the gateway also route images or embeddings here?

No. The API is text only, with no image, audio or embedding endpoints.

Generate your API key

Register, copy your unique key, and update your base URL. That is all.

https://api.oneapillm.com/v1uncensored

Get started with free credit

Sign up with email and password; receive your key instantly.