Skip to content

Your First Request

The Basics

TULIP exposes a single, unified API at https://api.tulip.tudelft.nl with OpenAI-compatible endpoints for three capabilities:

Capability Base Path Use Case
Chat /chat/v1 Conversational AI with reasoning & tool calling
Code /code/v1 Code generation and reasoning
Embeddings /embed/v1 Text vectorization for semantic search & RAG

TU Delft Network Access Required

TULIP is only reachable from the TU Delft network. Off campus, you must connect via eduVPN.

Authentication

Every request carries a credential in the Authorization: Bearer header. TULIP accepts two kinds:

  • SRAM personal token (recommended): join the tudelfttulip collaboration in SURF Research Access Management, then create a personal token on your SRAM profile page. Your access tier follows your group membership in the collaboration. Tokens are self-service: you can create and revoke them without contacting the TULIP team.
  • Legacy API key (sk-tulip-...): keys issued before the SRAM migration keep working until September 15, 2026, when they are disabled. All users must switch to SRAM tokens before that date.

The examples below work identically with either credential; set it as TUDELFT_TULIP_API_KEY.

Your First Request

Both examples below use the Chat Completions API. If you want configurable model selection (for example via TUDELFT_TULIP_MODEL_ALIAS), continue with Chat & General Inference.

Using cURL

Try It Yourself

This shell example expects TUDELFT_TULIP_API_KEY to be set and also uses jq. To keep setup simple, it uses the default chat model in the request body.

curl-hello-tulip.sh
#!/usr/bin/env bash

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ -f "$SCRIPT_DIR/../.env" ]; then
  source "$SCRIPT_DIR/../.env"
fi

: "${TUDELFT_TULIP_API_KEY:?Set TUDELFT_TULIP_API_KEY in .env or environment}"

curl -s --fail --silent --show-error https://api.tulip.tudelft.nl/chat/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${TUDELFT_TULIP_API_KEY}" \
  -d '{
    "model": "chat",
    "messages": [
      {"role": "user", "content": "Say hello from TULIP."}
    ]
  }' | jq .

And simply run:

bash curl-hello-tulip.sh

Using Python (OpenAI SDK)

Try It Yourself

The Python example reads TUDELFT_TULIP_API_KEY from .env if present and assumes openai and python-dotenv are installed. To keep setup simple, it uses the default chat model in the request body.

python_hello_tulip.py
import os
from pathlib import Path

from dotenv import load_dotenv
from openai import OpenAI

load_dotenv(dotenv_path=Path(__file__).parent.parent / ".env")

TUDELFT_TULIP_API_KEY = os.getenv("TUDELFT_TULIP_API_KEY")

if not TUDELFT_TULIP_API_KEY:
    raise RuntimeError("Set TUDELFT_TULIP_API_KEY in .env or the environment.")

client = OpenAI(
    base_url="https://api.tulip.tudelft.nl/chat/v1/", api_key=TUDELFT_TULIP_API_KEY
)

response = client.chat.completions.create(
    model="chat", messages=[{"role": "user", "content": "Say hello from TULIP."}]
)
print(response.choices[0].message.content)

And run:

python python_hello_tulip.py