API Reference
Chat completions
Request and response schema for the SID Chat Completions endpoint. The only supported model is SID-1.
/chat/completionsAuthorization
ApiKeyAuth 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
textstringrequiredtypestringrequiredrolestringrequirednamestringoptionalChatCompletionSystemMessageParam
contentstring | array<...>required
ChatCompletionContentPartTextParam
textstringrequiredtypestringrequiredrolestringrequirednamestringoptionalChatCompletionUserMessageParam
contentstring | array<...>required
ChatCompletionContentPartTextParam
textstringrequiredtypestringrequiredrolestringrequirednamestringoptionalChatCompletionAssistantMessageParam
rolestringrequiredcontentstring | array<...> | nulloptional
ChatCompletionContentPartTextParam
textstringrequiredtypestringrequirednamestringoptionalrefusalstring | nulloptionaltool_callsarray<...>optional
ChatCompletionMessageFunctionToolCallParam
idstringrequiredfunctionmaprequired
The function that the model called.
Function
argumentsstringrequirednamestringrequiredtypestringrequiredChatCompletionToolMessageParam
contentstring | array<...>required
ChatCompletionContentPartTextParam
textstringrequiredtypestringrequiredrolestringrequiredtool_call_idstringrequiredCustomChatCompletionMessageParam
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
namestringrequiredA 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.
typestringrequiredrolestringrequiredcontentstring | array<...>optional
ChatCompletionContentPartTextParam
textstringrequiredtypestringrequiredChatCompletionContentPartRefusalParam
refusalstringrequiredtypestringrequiredCustomThinkCompletionContentParam
thinkingstringrequiredtypestringrequiredclosedbooleanoptionalnamestringoptionaltool_call_idstring | nulloptionaltool_callsarray<...> | nulloptional
ChatCompletionMessageFunctionToolCallParam
idstringrequiredfunctionmaprequired
The function that the model called.
Function
argumentsstringrequirednamestringrequiredtypestringrequiredreasoningstring | nulloptionaltoolsarray<...> | 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
namestringrequiredA 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: functionAdditional parametersoptional
streamboolean | nulloptionaldefault: falsetool_choice"none" | "auto" | "required" | object | nulloptionaldefault: none
ChatCompletionNamedToolChoiceParam
functionmaprequired
ChatCompletionNamedFunction
namestringrequiredtypestringoptionaldefault: functionresponse_formatobject | object | nulloptional
ResponseFormat
type"text" | "json_object" | "json_schema"requiredjson_schemaobject | nulloptional
JsonSchemaResponseFormat
namestringrequireddescriptionstring | nulloptionalschemamap | nulloptionalstrictboolean | nulloptionalStructuralTagResponseFormat
typestringrequiredformatanyrequiredtemperaturenumber | nulloptionaltop_pnumber | nulloptionalmax_completion_tokensinteger | nulloptionalfrequency_penaltynumber | nulloptionaldefault: 0logit_biasmap | nulloptionallogprobsboolean | nulloptionaldefault: falsetop_logprobsinteger | nulloptionaldefault: 0max_tokensinteger | nulloptionaldeprecatedninteger | nulloptionaldefault: 1presence_penaltynumber | nulloptionaldefault: 0seedinteger | nulloptionalstopstring | array<string> | nulloptionaldefault: []stream_optionsobject | nulloptional
StreamOptions
include_usageboolean | nulloptionaldefault: truecontinuous_usage_statsboolean | nulloptionaldefault: falsereasoning_effortstring | nulloptionalinclude_reasoningbooleanoptionaldefault: trueparallel_tool_callsboolean | nulloptionaldefault: trueuserstring | nulloptionaluse_beam_searchbooleanoptionaldefault: falsetop_kinteger | nulloptionalmin_pnumber | nulloptionalrepetition_penaltynumber | nulloptionallength_penaltynumberoptionaldefault: 1stop_token_idsarray<integer> | nulloptionaldefault: []include_stop_str_in_outputbooleanoptionaldefault: falseignore_eosbooleanoptionaldefault: falsemin_tokensintegeroptionaldefault: 0skip_special_tokensbooleanoptionaldefault: truespaces_between_special_tokensbooleanoptionaldefault: truetruncate_prompt_tokensinteger | nulloptionalprompt_logprobsinteger | nulloptionalallowed_token_idsarray<integer> | nulloptionalbad_wordsarray<string>optionalechobooleanoptionaldefault: false
If true, the new message will be prepended with the last message if they belong to the same role.
add_generation_promptbooleanoptionaldefault: trueIf 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: falseIf 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: falseIf 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 | nulloptionalA 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 | nulloptionalAdditional 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 | nulloptionalregexstring | nulloptionalchoicearray<string> | nulloptionalgrammarstring | nulloptionaljson_objectboolean | nulloptionaldisable_fallbackbooleanoptionaldefault: falsedisable_any_whitespacebooleanoptionaldefault: falsedisable_additional_propertiesbooleanoptionaldefault: falsewhitespace_patternstring | nulloptionalstructural_tagstring | nulloptional_backendstring | nulloptional_backend_was_autobooleanoptionaldefault: falsereturn_tokens_as_token_idsboolean | nulloptionalIf 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 | nulloptionalIf 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