API
Nucleus speaks the OpenAI chat-completions format, so any OpenAI client library or tool works with it.
Getting started
- Sign in and create a key under Settings → API keys. It starts with
nk_and is shown only once. - Send it as a bearer token:
Authorization: Bearer nk_… - Base URL:
https://nucleus-ai.de/api/v1
Treat a key like a password. Anyone with it can use your daily API tokens. Revoke it in your settings if it leaks.
Examples
curl
curl https://nucleus-ai.de/api/v1/chat/completions \
-H "Authorization: Bearer $NUCLEUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "Why is the sky blue?"}], "max_tokens": 200}'
Python (openai library)
from openai import OpenAI
client = OpenAI(base_url="https://nucleus-ai.de/api/v1", api_key="nk_…")
stream = client.chat.completions.create(
model="nucleus",
messages=[{"role": "user", "content": "Why is the sky blue?"}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")
Endpoints
| Endpoint | What it does |
|---|---|
| GET /api/v1/models | The current model: version, context length (max_model_len) and whether it can see images. |
| POST /api/v1/chat/completions | A chat answer, as JSON or streamed (server-sent events). |
Chat parameters
| Parameter | Meaning |
|---|---|
| messages | The conversation: system, user, assistant and tool messages (up to 500). |
| max_tokens · max_completion_tokens | Length limit of the answer (default 1024, at most 8192 and what is left of your daily tokens). |
| stream | true streams the answer token by token. The last chunk carries usage. |
| temperature · top_p · top_k · seed | Sampling: randomness (0–2, default 0.7), nucleus sampling (default 0.95), top-k (0 = off), reproducible results. |
| stop | Up to 4 strings that end the answer. They are not included in it. |
| frequency_penalty · presence_penalty | −2 to 2. Positive values make repetitions less likely. |
| repetition_penalty | 1–2 (vLLM style). Above 1 discourages recently used tokens. |
| tools · tool_choice | Function calling in the OpenAI format. tool_choice: auto, none, required or {"type": "function", "function": {"name": …}}. Calls are always valid JSON for one of your functions with the required arguments – the server only lets the model write what fits the schema. |
| response_format | {"type": "json_object"} or {"type": "json_schema", "json_schema": {"schema": …}}: the answer is guaranteed to be JSON (matching the schema: types, properties, required, enum, items). |
| reasoning_effort | none (no thinking), low, medium, high – how long the model may think before it answers. |
The model returns its thoughts, if it has any, as reasoning_content. Not supported yet, and refused with an error instead of being ignored: n greater than 1 and logprobs.
Limits and errors
- 50,000 tokens per day and account (prompt and answer), reset at midnight (Berlin time). At most 120 requests per minute per key.
- Errors use the OpenAI format:
{"error": {"message": "…", "type": "…"}}.400invalid request401missing or revoked key403account timed out, or the API is switched off429limit reached503model not available
- The model is small and trained only on community texts, so its answers can be wrong. Don't use them for decisions that matter.