Documentation

api-inference

Run an inference API endpoint

Enable the OpenAI-compatible API endpoint, call it with curl and the Python OpenAI client, and integrate it into an existing pipeline.

If you enabled the API access method, your workspace serves an OpenAI-compatible inference endpoint. This guide shows you how to call it.

Step 1 — Find your endpoint and token

In the instance dashboard, open the Access card. Copy the API endpoint URL and the bearer token. The endpoint follows the OpenAI v1 API format.

Step 2 — Call the endpoint with curl

A basic completion request:

curl https://<your-host>/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-token>" \
  -d '{
    "model": "default",
    "messages": [{"role": "user", "content": "Summarise this in one sentence."}]
  }'

Step 3 — Use the OpenAI Python client

Point the openai package at your endpoint:

pip install openai
from openai import OpenAI

client = OpenAI(
    base_url="https://<your-host>/v1",
    api_key="<your-token>",
)

response = client.chat.completions.create(
    model="default",
    messages=[{"role": "user", "content": "Hello — who are you?"}],
)
print(response.choices[0].message.content)

Step 4 — Integrate into an existing pipeline

Because the endpoint is OpenAI-compatible, any library or tool that already speaks the OpenAI API works without modification — LangChain, LlamaIndex, Haystack, etc. Just replace base_url and api_key.