Add Apertis as a paid multi-provider upstream while keeping the local CLIProxyAPI endpoint and client workflow you already use.
No card is required to create an account. Choose a Coding Plan or add PAYG balance before your first API request.
Add an openai-compatibility provider to the CLIProxyAPI configuration. The
apertis prefix keeps these models explicit when the proxy also has OAuth or
other upstream accounts. Compare this example with the
official CLIProxyAPI configuration
for the installed version.
openai-compatibility:
- name: "apertis"
prefix: "apertis"
base-url: "https://api.apertis.ai/v1"
api-key-entries:
- api-key: "YOUR_APERTIS_API_KEY"
models:
- name: "YOUR_MODEL_ID"
alias: "YOUR_MODEL_ID"
Replace YOUR_MODEL_ID with an exact current ID from the
live model catalog. Add more model entries only
after verifying each one.
Apertis supports OpenAI SDK and Anthropic SDK requests, with both streaming and
non-streaming responses. Through CLIProxyAPI, point the SDK at the local
compatible endpoint and use the prefixed model name. Port 8317 is the
CLIProxyAPI default; use the configured local port if you changed it.
OpenAI-compatible clients use http://localhost:8317/v1. Anthropic SDK clients
use http://localhost:8317 because the SDK appends /v1/messages.
from openai import OpenAI
client = OpenAI(
api_key="YOUR_LOCAL_PROXY_KEY",
base_url="http://localhost:8317/v1",
)
response = client.chat.completions.create(
model="apertis/YOUR_MODEL_ID",
messages=[{"role": "user", "content": "Reply with OK"}],
stream=False,
)
print(response.choices[0].message.content)
from openai import OpenAI
client = OpenAI(
api_key="YOUR_LOCAL_PROXY_KEY",
base_url="http://localhost:8317/v1",
)
stream = client.chat.completions.create(
model="apertis/YOUR_MODEL_ID",
messages=[{"role": "user", "content": "Reply with OK"}],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
from anthropic import Anthropic
client = Anthropic(
api_key="YOUR_LOCAL_PROXY_KEY",
base_url="http://localhost:8317",
)
message = client.messages.create(
model="apertis/YOUR_MODEL_ID",
max_tokens=128,
messages=[{"role": "user", "content": "Reply with OK"}],
)
print(message.content[0].text)
from anthropic import Anthropic
client = Anthropic(
api_key="YOUR_LOCAL_PROXY_KEY",
base_url="http://localhost:8317",
)
with client.messages.stream(
model="apertis/YOUR_MODEL_ID",
max_tokens=128,
messages=[{"role": "user", "content": "Reply with OK"}],
) as stream:
for text in stream.text_stream:
print(text, end="")
Run one non-streaming request first, then its streaming equivalent. A completed setup is a model response followed by a matching request record in Activity. Repeat the check with the second SDK before moving a larger workload.
Create your Apertis account, then validate the response modes and their Activity records.