Skip to main content
Sully M1 is Sully’s general inference model. Its OpenAI-compatible Chat Completions API supports text generation, streaming, structured JSON, and client-executed function tools.

SDK quickstart

Use the OpenAI SDK with Sully’s OpenAI-compatible endpoint.
Create a client with the Sully endpoint and your account ID and API key as one composite credential:
Use sully-m1 as the model value unless Sully provides another model name.

HTTP request

A successful response uses the familiar OpenAI Chat Completions shape:
Token usage is included when available. Code should tolerate an omitted usage object.

Stream a response

Set stream: true. With the OpenAI SDK, iterate over completion chunks:
At the HTTP level, streaming uses server-sent events and ends with 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:
The non-streaming API verifies that a completed JSON-mode answer is parseable JSON. Clients using 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.
Send the tool result in a subsequent request using the normal OpenAI tool message shape and the returned tool_call_id.

Supported request fields

The Chat Completions endpoint honors:
  • messages
  • model
  • stream and stream_options.include_usage
  • max_completion_tokens
  • temperature, top_p, seed, and stop
  • tools and tool_choice
  • response_format
  • reasoning_effort: none, minimal, low, medium, high, xhigh, or max
  • logprobs, top_logprobs, and logit_bias when enabled for the model
Only one completion is generated per request. Unknown top-level fields are ignored. Inline 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.

Data handling

Sully M1 does not retain prompts or completions by default. Keep your own application logs free of clinical content unless your approved data handling policy requires it.