Build
SDKs and frameworks
Working setups for the OpenAI and Anthropic SDKs, LangChain, and the Vercel AI SDK.
OpenAI SDKs
Point the client at https://api.quancis.space/v1 and use your Quancis key. Both the Chat Completions and Responses APIs work.
from openai import OpenAI
client = OpenAI(
base_url="https://api.quancis.space/v1",
api_key="sk-quan-...",
)
reply = client.chat.completions.create(
model="kael-beta",
messages=[{"role": "user", "content": "Review this function."}],
)
print(reply.choices[0].message.content)Anthropic SDKs
Use https://api.quancis.space without /v1. Anthropic SDKs add /v1/messages themselves, so a base URL that already ends in /v1 would call /v1/v1/messages and fail.
import anthropic
client = anthropic.Anthropic(
base_url="https://api.quancis.space", # no /v1
api_key="sk-quan-...",
)
message = client.messages.create(
model="kael-beta",
max_tokens=1024,
messages=[{"role": "user", "content": "Review this function."}],
)
print(message.content[0].text)Frameworks
Any framework that lets you set an OpenAI-compatible base URL will work. These two are tested patterns:
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="kael-beta",
base_url="https://api.quancis.space/v1",
api_key="sk-quan-...",
)
print(llm.invoke("Review this function.").content)Environment variables
Tools that read the standard variables need no code change:
| Tools that use | Set |
|---|---|
| OpenAI SDKs and OpenAI-compatible tools | OPENAI_BASE_URL=https://api.quancis.space/v1 and OPENAI_API_KEY=sk-quan-... |
| Anthropic SDKs and Anthropic-compatible tools | ANTHROPIC_BASE_URL=https://api.quancis.space and ANTHROPIC_API_KEY=sk-quan-... |
Client settings that matter
- Set request timeouts above 8 minutes, or stream. Hard requests can run for minutes.
- The SDKs retry some failures on their own. That is fine for
429and5xx; see Errors for what is safe to retry.