API Reference

Chat completions

Request and response schema for the SID Chat Completions endpoint. The only supported model is SID-1.

POST/chat/completions

Authorization

ApiKeyAuth
Authorization

Authenticate with your SID API key as a bearer token: Authorization: Bearer $SID_API_KEY. Create and revoke keys in the dashboard.

: header

Request

curl https://api.sid-1.com/v1/chat/completions \  -H "Authorization: Bearer $SID_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "sid-1",    "messages": [      { "role": "system", "content": "You are SID-1, an agentic retrieval model. Search the knowledge base to answer the question. Use `search` for semantic queries, `text_search` for exact keywords and phrases, and `read` to fetch a document's full text by id. Issue tool calls in parallel when you can. When you have enough evidence, call `report_helpful_ids` with the document ids that best answer the question, ranked most helpful first." },      { "role": "user", "content": "Which clauses in our master agreement were overridden by later amendments?" }    ],    "tools": [      { "type": "function", "function": { "name": "search" } },      { "type": "function", "function": { "name": "text_search" } },      { "type": "function", "function": { "name": "read" } },      { "type": "function", "function": { "name": "report_helpful_ids" } }    ]  }'
import osfrom openai import OpenAIclient = OpenAI(    api_key=os.environ["SID_API_KEY"],    base_url="https://api.sid-1.com/v1",)SYSTEM_PROMPT = (    "You are SID-1, an agentic retrieval model. Search the knowledge base to answer the question. Use `search` for semantic queries, `text_search` for exact keywords and phrases, and `read` to fetch a document's full text by id. Issue tool calls in parallel when you can. When you have enough evidence, call `report_helpful_ids` with the document ids that best answer the question, ranked most helpful first.")tools = [    {"type": "function", "function": {"name": "search"}},    {"type": "function", "function": {"name": "text_search"}},    {"type": "function", "function": {"name": "read"}},    {"type": "function", "function": {"name": "report_helpful_ids"}},]response = client.chat.completions.create(    model="sid-1",    messages=[        {"role": "system", "content": SYSTEM_PROMPT},        {            "role": "user",            "content": "Which clauses in our master agreement were overridden by later amendments?",        },    ],    tools=tools,)# sid-1 replies with tool calls — run them against your search backend, append# the results to messages, and call again until it returns report_helpful_ids.print(response.choices[0].message.tool_calls)
import OpenAI from "openai";const client = new OpenAI({  apiKey: process.env.SID_API_KEY,  baseURL: "https://api.sid-1.com/v1",});const systemPrompt =  "You are SID-1, an agentic retrieval model. Search the knowledge base to answer the question. Use `search` for semantic queries, `text_search` for exact keywords and phrases, and `read` to fetch a document's full text by id. Issue tool calls in parallel when you can. When you have enough evidence, call `report_helpful_ids` with the document ids that best answer the question, ranked most helpful first.";const tools: OpenAI.Chat.Completions.ChatCompletionTool[] = [  { type: "function", function: { name: "search" } },  { type: "function", function: { name: "text_search" } },  { type: "function", function: { name: "read" } },  { type: "function", function: { name: "report_helpful_ids" } },];const response = await client.chat.completions.create({  model: "sid-1",  messages: [    { role: "system", content: systemPrompt },    {      role: "user",      content:        "Which clauses in our master agreement were overridden by later amendments?",    },  ],  tools,});// sid-1 replies with tool calls — run them against your search backend, append// the results to messages, and call again until it returns report_helpful_ids.console.log(response.choices[0]?.message?.tool_calls);

Request Body

application/json

model"sid-1"required

The only supported model is "sid-1". New model versions ship under new ids; pin to a specific id to keep behaviour stable.

messagesarray<...>required
ChatCompletionDeveloperMessageParam
contentstring | array<...>required
ChatCompletionContentPartTextParam
textstringrequired
typestringrequired
rolestringrequired
namestringoptional
ChatCompletionSystemMessageParam
contentstring | array<...>required
ChatCompletionContentPartTextParam
textstringrequired
typestringrequired
rolestringrequired
namestringoptional
ChatCompletionUserMessageParam
contentstring | array<...>required
ChatCompletionContentPartTextParam
textstringrequired
typestringrequired
rolestringrequired
namestringoptional
ChatCompletionAssistantMessageParam
rolestringrequired
contentstring | array<...> | nulloptional
ChatCompletionContentPartTextParam
textstringrequired
typestringrequired
namestringoptional
refusalstring | nulloptional
tool_callsarray<...>optional
ChatCompletionMessageFunctionToolCallParam
idstringrequired
functionmaprequired

The function that the model called.

Function
argumentsstringrequired
namestringrequired
typestringrequired
ChatCompletionToolMessageParam
contentstring | array<...>required
ChatCompletionContentPartTextParam
textstringrequired
typestringrequired
rolestringrequired
tool_call_idstringrequired
CustomChatCompletionMessageParam
toolsarray<...> | nulloptional
ChatCompletionFunctionToolParam
functionobjectrequired

A single name-only placeholder stub. Passing one stub turns on tool-call parsing for every tool; the field's contents are ignored. SID-1 reads each tool's name and behavior from the system prompt, not from this field. Do not pass multiple stubs or add description or parameters here.

FunctionDefinition
namestringrequired

A placeholder name such as dummy. The value is ignored; the stub only needs to be present. Tool names and behavior are defined in the system prompt, not here.

typestringrequired
rolestringrequired
contentstring | array<...>optional
ChatCompletionContentPartTextParam
textstringrequired
typestringrequired
ChatCompletionContentPartRefusalParam
refusalstringrequired
typestringrequired
CustomThinkCompletionContentParam
thinkingstringrequired
typestringrequired
closedbooleanoptional
namestringoptional
tool_call_idstring | nulloptional
tool_callsarray<...> | nulloptional
ChatCompletionMessageFunctionToolCallParam
idstringrequired
functionmaprequired

The function that the model called.

Function
argumentsstringrequired
namestringrequired
typestringrequired
reasoningstring | nulloptional
toolsarray<...> | nulloptional
ChatCompletionToolsParam
functionobjectrequired

A single name-only placeholder stub. Passing one stub turns on tool-call parsing for every tool; the field's contents are ignored. SID-1 reads each tool's name and behavior from the system prompt, not from this field. Do not pass multiple stubs or add description or parameters here.

FunctionDefinition
namestringrequired

A placeholder name such as dummy. The value is ignored; the stub only needs to be present. Tool names and behavior are defined in the system prompt, not here.

typestringoptionaldefault: function
Additional parametersoptional
streamboolean | nulloptionaldefault: false
tool_choice"none" | "auto" | "required" | object | nulloptionaldefault: none
ChatCompletionNamedToolChoiceParam
functionmaprequired
ChatCompletionNamedFunction
namestringrequired
typestringoptionaldefault: function
response_formatobject | object | nulloptional
ResponseFormat
type"text" | "json_object" | "json_schema"required
json_schemaobject | nulloptional
JsonSchemaResponseFormat
namestringrequired
descriptionstring | nulloptional
schemamap | nulloptional
strictboolean | nulloptional
StructuralTagResponseFormat
typestringrequired
formatanyrequired
temperaturenumber | nulloptional
top_pnumber | nulloptional
max_completion_tokensinteger | nulloptional
frequency_penaltynumber | nulloptionaldefault: 0
logit_biasmap | nulloptional
logprobsboolean | nulloptionaldefault: false
top_logprobsinteger | nulloptionaldefault: 0
max_tokensinteger | nulloptionaldeprecated
ninteger | nulloptionaldefault: 1
presence_penaltynumber | nulloptionaldefault: 0
seedinteger | nulloptional
stopstring | array<string> | nulloptionaldefault: []
stream_optionsobject | nulloptional
StreamOptions
include_usageboolean | nulloptionaldefault: true
continuous_usage_statsboolean | nulloptionaldefault: false
reasoning_effortstring | nulloptional
include_reasoningbooleanoptionaldefault: true
parallel_tool_callsboolean | nulloptionaldefault: true
userstring | nulloptional
use_beam_searchbooleanoptionaldefault: false
top_kinteger | nulloptional
min_pnumber | nulloptional
repetition_penaltynumber | nulloptional
length_penaltynumberoptionaldefault: 1
stop_token_idsarray<integer> | nulloptionaldefault: []
include_stop_str_in_outputbooleanoptionaldefault: false
ignore_eosbooleanoptionaldefault: false
min_tokensintegeroptionaldefault: 0
skip_special_tokensbooleanoptionaldefault: true
spaces_between_special_tokensbooleanoptionaldefault: true
truncate_prompt_tokensinteger | nulloptional
prompt_logprobsinteger | nulloptional
allowed_token_idsarray<integer> | nulloptional
bad_wordsarray<string>optional
echobooleanoptionaldefault: false

If true, the new message will be prepended with the last message if they belong to the same role.

add_generation_promptbooleanoptionaldefault: true

If true, the generation prompt will be added to the chat template. This is a parameter used by chat template in tokenizer config of the model.

continue_final_messagebooleanoptionaldefault: false

If this is set, the chat will be formatted so that the final message in the chat is open-ended, without any EOS tokens. The model will continue this message rather than starting a new one. This allows you to "prefill" part of the model's response for it. Cannot be used at the same time as add_generation_prompt.

add_special_tokensbooleanoptionaldefault: false

If true, special tokens (e.g. BOS) will be added to the prompt on top of what is added by the chat template. For most models, the chat template takes care of adding the special tokens so this should be set to false (as is the default).

chat_templatestring | nulloptional

A Jinja template to use for this conversion. As of transformers v4.44, default chat template is no longer allowed, so you must provide a chat template if the tokenizer does not define one.

chat_template_kwargsmap | nulloptional

Additional keyword args to pass to the template renderer. Will be accessible by the chat template.

structured_outputsobject | nulloptional

Additional kwargs for structured outputs

StructuredOutputsParams
jsonstring | map | nulloptional
regexstring | nulloptional
choicearray<string> | nulloptional
grammarstring | nulloptional
json_objectboolean | nulloptional
disable_fallbackbooleanoptionaldefault: false
disable_any_whitespacebooleanoptionaldefault: false
disable_additional_propertiesbooleanoptionaldefault: false
whitespace_patternstring | nulloptional
structural_tagstring | nulloptional
_backendstring | nulloptional
_backend_was_autobooleanoptionaldefault: false
return_tokens_as_token_idsboolean | nulloptional

If specified with 'logprobs', tokens are represented as strings of the form 'token_id:{token_id}' so that tokens that are not JSON-encodable can be identified.

return_token_idsboolean | nulloptional

If specified, the result will include token IDs alongside the generated text. In streaming mode, prompt_token_ids is included only in the first chunk, and token_ids contains the delta tokens for each chunk. This is useful for debugging or when you need to map generated text back to input tokens.

ResponseJSON

{
  "id": "chatcmpl-req_93b52f66-00d3-40c3-ac43-560c437461f6",
  "object": "chat.completion",
  "model": "sid-1",
  "choices": [
    {
      "index": 0,
      "finish_reason": "tool_calls",
      "message": {
        "role": "assistant",
        "content": "<think>\nI'll run a few searches in parallel and a lexical search for the exact phrase.\n</think>\n\n",
        "tool_calls": [
          {
            "id": "chatcmpl-tool-1a2b3c4d",
            "type": "function",
            "function": {
              "name": "search",
              "arguments": "{\"query\": \"indoor 4 minute mile record city\", \"limit\": 5}"
            }
          },
          {
            "id": "chatcmpl-tool-5e6f7a8b",
            "type": "function",
            "function": {
              "name": "search",
              "arguments": "{\"query\": \"outdoor 4 minute mile record city\", \"limit\": 5}"
            }
          },
          {
            "id": "chatcmpl-tool-9c0d1e2f",
            "type": "function",
            "function": {
              "name": "text_search",
              "arguments": "{\"query\": \"four-minute mile world record\", \"limit\": 10}"
            }
          }
        ]
      }
    }
  ],
  "usage": {
    "prompt_tokens": 616,
    "completion_tokens": 118,
    "total_tokens": 734
  }
}

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

Content