Skip to content

API reference

Chat completions

POST /v1/chat/completions. The OpenAI chat completions format, answered from the record within the caller's clearance.

POST https://YOUR-DOOR-ADDRESS/v1/chat/completions

Requests and responses follow the OpenAI chat completions API. Use the OpenAI SDK with base_url set to your door address plus /v1, and your credential headers as default headers. See Doors and credentials.

Field Type Notes
model string, required A model alias configured for your organization. See Models.
messages array, required Non-empty. Roles system, developer, user, assistant and tool. A developer message is treated as system.
max_completion_tokens integer Upper bound on generated tokens. max_tokens is accepted as well.
temperature number As in the standard API.
tools array Function tools, as in the standard API.
tool_choice string or object As in the standard API.
metadata object As in the standard API.
stream boolean true streams server-sent events in the standard chunk format.

A request body can’t include organization or principal identity. The door limits the number of messages and tools per request.

import os
from openai import OpenAI
from syderial_headers import load_headers # helper from the Quickstart
client = OpenAI(
base_url=os.environ["SYDERIAL_DOOR_URL"] + "/v1",
api_key="unused",
default_headers=load_headers(),
)
completion = client.chat.completions.create(
model=os.environ["SYDERIAL_MODEL"],
messages=[
{"role": "system", "content": "Answer from the record. Say when the record is silent."},
{"role": "user", "content": "Which decisions changed the V-204 maintenance plan?"},
],
max_completion_tokens=800,
)
print(completion.choices[0].message.content)

A standard chat completion object, or a stream of standard chunks when stream is true. Syderial adds the evidence and a receipt reference alongside the standard fields. See What Syderial adds to a response.