de.NBI de.NBI Cloud Berlin LLM API — Quickstart Guide

BIH Logo Charite Logo de.NBI Logo

Before You Start

This guide assumes you have already obtained an API key. If you don't have one yet, contact denbi-cloud@bih-charite.de.

The API is compatible with the OpenAI Chat Completions format, so it works with any OpenAI client library or tool that supports custom endpoints.

Other Ways to Use the API

You're not limited to curl or Python. Here are popular alternatives — all require you to configure the endpoint and API key in their settings. After configuring, remember to also select the model from our available models list when starting a conversation.

LM Studio

Run models locally on your own machine — no API key needed. Download and run open-weight models directly on your hardware for offline use.

Note: LM Studio runs models locally on your device. It does not connect to remote APIs. For cloud-powered inference via our API, use Cherry Studio, Chatbox, or the code examples below.
lmstudio.ai →

Cherry Studio

A desktop GUI for chatting with LLMs. Supports multiple providers and custom OpenAI-compatible endpoints.

Setup: Go to Settings → Model Providers → Add Custom Provider → set Base URL to our endpoint and paste your API key. Then select the model in the chat interface.
cherryai.com →

Chatbox

A clean, cross-platform chat interface. Works great with custom API endpoints for team use.

Setup: Go to Settings → AI Provider → OpenAI Compatible → enter our endpoint URL and API key. Then choose the model from the provider's model list.
chatboxai.app →

Disclaimer: These third-party tools are listed as examples only. We are not affiliated with, endorsed by, or responsible for any of these programs, their functionality, security, or improper usage. Please review each tool's privacy policy and terms of service independently. For official support, use the curl or Python examples provided in this guide.

General tip for GUI tools (Cherry Studio, Chatbox): Look for settings labeled "OpenAI Compatible", "Custom API", or "Remote Provider". Set the Base URL to our endpoint (https://denbi-llm-api.bihealth.org/v1) and the API Key you obtained from denbi-cloud@bih-charite.de. After configuring, don't forget to select the model — the model field can be any model ID from our available models list (e.g., gpt-oss-120b, qwen3.8-27b).

Quickstart — 5 Minutes to Your First Request

1

Choose your endpoint

Use our endpoint from anywhere:

OpenAI-compatible

https://denbi-llm-api.bihealth.org/v1

check our page regularly for updates

2

Pick a model

Each model has a short identifier (model-id) that you pass in your request. Check the Available Models section on the main page for the full list.

Example model IDs

gpt-oss-120b

qwen3.8-27b

gemma-4-31b

In your request

Set "model": "gpt-oss-120b" in the JSON body.

3

Make your first request (curl)

Replace YOUR_API_KEY with your API key:

One-liner (copy-paste ready):
curl https://denbi-llm-api.bihealth.org/v1/chat/completions -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"model": "gpt-oss-120b", "messages": [{"role": "user", "content": "What is the capital of France?"}], "max_tokens": 512}'
Formatted version (easier to read):
# Basic chat completion with max_tokens limit
curl https://denbi-llm-api.bihealth.org/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-oss-120b",
    "messages": [
      {"role": "user", "content": "What is the capital of France?"}
    ],
    "max_tokens": 512
  }'

Note: The endpoint path is /v1/chat/completions — this matches the OpenAI API structure exactly. The max_tokens parameter limits the response length.

4

Try it with Python

Set up a Python virtual environment, install the OpenAI library, and make your first request:

Step 4a: Create and activate a virtual environment:
# Create a virtual environment
python3 -m venv denbi-env

# Activate it (Linux/Mac)
source denbi-env/bin/activate

# Activate it (Windows PowerShell)
# .\denbi-env\Scripts\Activate.ps1

# Activate it (Windows CMD)
# denbi-env\Scripts\activate.bat
Step 4b: Install the OpenAI library:
pip install openai
Step 4c: Create a file called chat.py and add this code:
from openai import OpenAI

client = OpenAI(
    base_url="https://denbi-llm-api.bihealth.org/v1",
    api_key="YOUR_API_KEY"
)

response = client.chat.completions.create(
    model="gpt-oss-120b",
    messages=[
        {"role": "user", "content": "Explain DNA replication in one sentence."}
    ],
    max_tokens=512
)

print(response.choices[0].message.content)
Step 4d: Run it:
python chat.py

Tip: Replace YOUR_API_KEY with your API key. Store sensitive keys in environment variables, never hard-code them in production.

5

Stream responses

For long outputs, enable streaming to get tokens as they're generated:

from openai import OpenAI

client = OpenAI(
    base_url="https://denbi-llm-api.bihealth.org/v1",
    api_key="YOUR_API_KEY"
)

stream = client.chat.completions.create(
    model="gpt-oss-120b",
    messages=[{"role": "user", "content": "Write a short poem about bioinformatics."}],
    max_tokens=1024,
    stream=True
)

for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

Tip: Streaming is especially useful for interactive applications and long-form generation. The max_tokens parameter prevents excessively long responses.

Common Parameters

Parameter Type Description
model string The model ID to use (e.g., gpt-oss-120b)
messages array Array of message objects with role and content
max_tokens integer Maximum number of tokens to generate. Default: varies by model. Recommended: 512–2048.
stream boolean If true, tokens are sent as server-sent events. Default: false.

Multi-turn Conversations

Include previous messages to maintain context across turns. The model sees the full conversation history:

One-liner (copy-paste ready):
curl https://denbi-llm-api.bihealth.org/v1/chat/completions -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"model": "gpt-oss-120b", "messages": [{"role": "system", "content": "You are a helpful biology assistant."}, {"role": "user", "content": "What is CRISPR?"}, {"role": "assistant", "content": "CRISPR is a gene-editing technology..."}, {"role": "user", "content": "Can you explain it simpler?"}], "max_tokens": 512}'
Formatted version (easier to read):
curl https://denbi-llm-api.bihealth.org/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-oss-120b",
    "messages": [
      {"role": "system", "content": "You are a helpful biology assistant."},
      {"role": "user", "content": "What is CRISPR?"},
      {"role": "assistant", "content": "CRISPR is a gene-editing technology..."},
      {"role": "user", "content": "Can you explain it simpler?"}
    ],
    "max_tokens": 512
  }'

Important: Longer conversations consume more tokens. Be mindful of your token usage for very long threads. Use max_tokens to control response length.

Error Handling

The API returns standard HTTP status codes and error messages:

Status Meaning What to do
200 Success Your response is in the JSON body
401 Unauthorized Check your API key
429 Rate limited Wait and retry with exponential backoff
500 Server error Contact support if persistent

Errors include a message field with details. Always check this when debugging.

Best Practices

Need Help?

Contact denbi-cloud@bih-charite.de for technical support, questions, or feedback.