EN ▾
Get API key
Uncensored, OpenAI-compatible API for developers https://api.apertus.cc/v1

Apertus LLM API: How to Reach It, and an Alternative

There is no single official Apertus LLM API that works like the big commercial ones. You can run the open weights yourself, find a host that serves them, or use a different hosted model through the same OpenAI-style interface.

Updated

Isometric illustration of a local server linked by a light bridge to a hosted API endpoint

Key points

  • Apertus is an open Swiss model, so access means self-hosting or finding a third-party host.
  • Any host that speaks the OpenAI chat format can be swapped in by changing a base URL and key.
  • This site serves a different model, uncensored, not Apertus, at $0.15 and $0.50 per 1M tokens.
  • A $0.50 trial credit lets you test the hosted endpoint before you pay anything.

What API access to Apertus actually means

Apertus is an open language model developed in Switzerland by academic and national research institutions, including EPFL, ETH Zurich and the Swiss National Supercomputing Centre. It was published with open weights and detailed documentation of how it was built, and it comes in a smaller and a larger size. That openness is the whole point of the project, and it shapes what an "API" for it looks like.

With a closed commercial model, one company runs the servers and sells you a key. With an open model, the weights are a download. Anyone can serve them, so access is split across several routes: your own GPU box, a cloud provider that has added the model to its catalogue, or a research deployment run by the project partners. Which of these is available changes over time, so check each provider's current model list instead of trusting an old blog post, including this one.

The practical consequence is simple. If you need Apertus specifically, you will either run it or pick a host. If what you really need is a text model behind an OpenAI-style endpoint that does not lecture you, there is a shorter path, covered further down.

Three realistic routes to Apertus

Route 1: self-host the weights

You download the weights from the model hub, load them in an inference server, and expose an OpenAI-compatible endpoint on your own machine. You control everything: the system prompt, the sampling settings, the logs. You also pay for the hardware, the electricity and the time to keep it running. The smaller size fits on a single decent GPU with quantization. The larger size needs several GPUs or one very large one.

Route 2: a third-party inference host

Some inference providers add popular open models to their catalogue. If one of them lists Apertus, you get a key and a base URL, and you pay per token or per hour, depending on their plan. Prices and limits are theirs to set, so check their current pricing page. We have a separate page comparing a hosted route with ours: see the DeepInfra comparison.

Route 3: a research or institutional deployment

The project partners have run public demos and academic access programmes. These are fine for evaluation but are rarely meant for production traffic, and they tend to have usage rules you must read first.

Self-hosting sketch with vLLM

If you choose route 1, the usual tool is vLLM, which can serve a Hugging Face model behind an OpenAI-compatible HTTP server. The outline below uses a placeholder for the model name, because you should copy the exact repository ID from the model's own page and read its licence there.

pip install vllm

# replace the placeholder with the repo ID from the model page
vllm serve <apertus-repo-id> --port 8000 --max-model-len 16384

# test it
curl http://localhost:8000/v1/models

Two details trip people up. First, context length costs memory: asking for a long window on a small GPU ends in an out-of-memory error, so start with 8,000 to 16,000 tokens and raise it only if you need it. Second, use the chat template that ships with the instruct variant. If you send raw text to a chat-tuned model, answers get strange fast.

Once the server is up, any OpenAI client works against http://localhost:8000/v1. That detail matters for the next section, because the same client code can later point at a hosted endpoint.

A hosted alternative: the uncensored model on this site

This site does not serve Apertus. It serves one other open-weight model under the ID uncensored, run by an independent provider and tuned to answer without content refusals for lawful adult use. It is not an official API of any model vendor and it is not a router across vendors. The hard limit is that sexual content involving minors is never produced.

It is text only: chat completions and a models list, with no images, audio, embeddings or fine-tuning. The context window is 100,000 tokens, shared between prompt and completion. Streaming, tool calling and JSON mode work, and sampling settings such as temperature, top_p, stop and seed are passed through.

If you are comparing an Apertus LLM API against this one, the honest framing is that they answer different needs. Apertus gives you open provenance and control. This endpoint gives you a working URL in a few minutes, billed per token. The quickstart covers the details.

Calling it from Python, Node and curl

The base URL is https://api.apertus.cc/v1, the model ID is uncensored, and auth is a standard bearer token. After you get an API key, this is a complete Python call:

from openai import OpenAI

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

resp = client.chat.completions.create(
    model="uncensored",
    messages=[
        {"role": "system", "content": "You are a direct, plain-spoken assistant."},
        {"role": "user", "content": "Outline a three-act structure for a heist story."},
    ],
    temperature=0.8,
)
print(resp.choices[0].message.content)
print(resp.usage)

Streaming in Node uses the same client library. The final chunk includes usage, so you can log what each request cost:

import OpenAI from "openai";

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

const stream = await client.chat.completions.create({
  model: "uncensored",
  messages: [{ role: "user", content: "Give me five names for a ship's AI." }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

And the same request as plain curl, handy for checking a key before you write any code:

curl https://api.apertus.cc/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Say hello in three languages."}],
    "max_tokens": 120
  }'

Responses carry an X-Balance-USD header with your remaining credit, plus X-Request-Id for support questions.

Keep your code portable between endpoints

The smartest thing you can do while you decide is to avoid hard-coding any one provider. Put the base URL, key and model name in environment variables and read them at start-up. Then moving from a local vLLM server to a hosted API is a config change, not a rewrite.

import os
from openai import OpenAI

client = OpenAI(
    base_url=os.environ["LLM_BASE_URL"],   # e.g. https://api.apertus.cc/v1
    api_key=os.environ["LLM_API_KEY"],
)
MODEL = os.environ.get("LLM_MODEL", "uncensored")

Keep prompts in files, not scattered through the code, and keep a small set of test prompts with the answers you consider acceptable. Different models phrase things differently, so a prompt tuned for one may need small edits for another. A dozen saved cases will show you the difference in ten minutes.

Treat the key like any secret. Keep it in an environment variable or a secrets manager, never in a repository or in front-end code that ships to browsers. If you build a web product, call the API from your own server and let the browser talk to your server. That also lets you add your own per-user rate limits, so one noisy user cannot burn through the shared concurrency slots.

Mind the limits when you scale up. A full key allows 8 concurrent requests and 300 requests per minute. A trial key allows 2 and 60. A streamed request holds its concurrency slot until the stream ends, which catches people who fire many long generations at once. Over a limit you get HTTP 429 with the code rate_limited or concurrency. On temporary overload you also get 429 with Retry-After: 5, so a simple retry with a short sleep is enough.

What it costs, with real numbers

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, and credit does not expire. The full table is on the pricing page.

Take a support-style workload of 10,000 requests, each with 2,000 input tokens and 500 output tokens. Input is 20M tokens, which costs 20 × $0.15 = $3.00. Output is 5M tokens, which costs 5 × $0.50 = $2.50. The total is $5.50 for the batch.

A long-document job looks different. Say 100 requests with 50,000 input tokens and 1,000 output tokens each. Input is 5M tokens, so $0.75. Output is 0.1M tokens, so $0.05. The total is $0.80. The new-user trial of $0.50 is claimed with one click on the key page, needs no payment details and lasts 7 days, which is enough for roughly 900 requests of the first, smaller size.

Top-ups are any whole amount from $20 to $500, with a bonus of 5% from $50, 10% from $100 and 15% from $200. Payment is crypto only, in USDT on TRC20 or USDC on Base.

Questions and answers

Is there an official API for Apertus?

Apertus is an open model, so access usually means running the weights yourself or using a host that has added it. Check the project's own pages and each provider's model list for what is available now.

Does this site serve Apertus?

No. It serves a different open-weight model under the ID uncensored. It is a separate choice, offered through an OpenAI-compatible API.

Can I use the OpenAI SDK with it?

Yes. Set the base URL to https://api.apertus.cc/v1, use your key as the bearer token and set the model to uncensored. Chat completions and the models list are supported.

Are my prompts used for training?

No. Prompts sent to this API are not used for training.

How do I try it without paying?

Sign up with Google or email and password, then claim the $0.50 trial credit on the API key page. It needs no payment details and is valid for 7 days.

Your key is one form away

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