API reference
Messages
POST /v1/messages. The Anthropic messages format, answered from the record within the caller's clearance.
POST https://YOUR-DOOR-ADDRESS/v1/messagesRequests and responses follow the Anthropic messages API. Use the Anthropic SDK with base_url set to your door address (without /v1, which the SDK adds) and your credential headers as default headers. See Doors and credentials.
Request fields the door reads
Section titled “Request fields the door reads”| Field | Type | Notes |
|---|---|---|
model |
string, required | A model alias configured for your organization. See Models. |
max_tokens |
integer, required | Upper bound on generated tokens. |
messages |
array, required | Non-empty. Roles user and assistant. Content is a string or an array of text, image, tool_use and tool_result blocks. |
system |
string or array | A string or an array of text blocks. |
tools |
array | Client tools, as in the standard API. |
tool_choice |
object | As in the standard API. |
metadata |
object | As in the standard API. |
stream |
boolean | true streams server-sent events in the standard event format. |
A request body can’t include organization or principal identity. The door limits the number of messages and tools per request.
Example
Section titled “Example”import osimport anthropicfrom syderial_headers import load_headers # helper from the Quickstart
client = anthropic.Anthropic( base_url=os.environ["SYDERIAL_DOOR_URL"], api_key="unused", default_headers=load_headers(),)
message = client.messages.create( model=os.environ["SYDERIAL_MODEL"], max_tokens=800, system="Answer from the record. Say when the record is silent.", messages=[ {"role": "user", "content": "Which decisions changed the V-204 maintenance plan?"}, ],)
print(message.content[0].text)import Anthropic from "@anthropic-ai/sdk";import { loadHeaders } from "./syderial-headers"; // helper from the Quickstart
const client = new Anthropic({ baseURL: process.env.SYDERIAL_DOOR_URL, apiKey: "unused", defaultHeaders: loadHeaders(),});
const message = await client.messages.create({ model: process.env.SYDERIAL_MODEL!, max_tokens: 800, system: "Answer from the record. Say when the record is silent.", messages: [ { role: "user", content: "Which decisions changed the V-204 maintenance plan?" }, ],});
for (const block of message.content) { if (block.type === "text") console.log(block.text);}curl "$SYDERIAL_DOOR_URL/v1/messages" \ -H @syderial-headers.txt \ -H "content-type: application/json" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "'"$SYDERIAL_MODEL"'", "max_tokens": 800, "system": "Answer from the record. Say when the record is silent.", "messages": [ {"role": "user", "content": "Which decisions changed the V-204 maintenance plan?"} ] }'Streaming
Section titled “Streaming”with client.messages.stream( model=os.environ["SYDERIAL_MODEL"], max_tokens=800, messages=[{"role": "user", "content": "Summarise the V-204 record."}],) as stream: for text in stream.text_stream: print(text, end="", flush=True)Response
Section titled “Response”A standard message object, or a standard event stream when stream is true. Syderial adds the evidence and a receipt reference alongside the standard fields. See What Syderial adds to a response.