SDK quickstart
Use the OpenAI SDK with Sully’s OpenAI-compatible endpoint.sully-m1 as the model value unless Sully provides another model name.
HTTP request
usage
object.
Stream a response
Setstream: true. With the OpenAI SDK, iterate over completion chunks:
data: [DONE]. When stream_options.include_usage is true, the final JSON frame
has an empty choices array and contains usage. It may contain usage: null.
Request JSON output
Use JSON mode when you need parseable JSON:json_schema should still validate the response against their schema.
Streaming JSON may be incomplete until the final chunk arrives.
Use function tools
Tools are returned to your application; Sully does not execute them.tool_call_id.
Supported request fields
The Chat Completions endpoint honors:messagesmodelstreamandstream_options.include_usagemax_completion_tokenstemperature,top_p,seed, andstoptoolsandtool_choiceresponse_formatreasoning_effort:none,minimal,low,medium,high,xhigh, ormaxlogprobs,top_logprobs, andlogit_biaswhen enabled for the model
data: image URLs are accepted in message content; remote image URLs are
not fetched.
Errors and retries
Errors use the OpenAI error envelope:
Every response includes
x-request-id. Capture it for support and debugging.