Skip to main content
POST
Create a chat completion

Authorizations

Authorization
string
header
required

Your Deepshi API key, sent as Authorization: Bearer <key>.

Body

application/json

Unsupported or model-specific fields are ignored rather than rejected.

model
string
required

The model id to use, e.g. deepshi-3.0 or gpt-4o. Use the bare id returned by GET /v1/models, not a provider-prefixed id.

Example:

"deepshi-3.0"

messages
object[]
required

The conversation so far, oldest first.

temperature
number

Sampling temperature. Lower is more deterministic.

Required range: 0 <= x <= 2
top_p
number

Nucleus sampling cutoff. Use instead of temperature, not both.

Required range: 0 <= x <= 1
max_tokens
integer

Maximum tokens to generate in the response.

max_completion_tokens
integer

Alias of max_tokens accepted for OpenAI compatibility.

reasoning_effort
string

Controls how much a reasoning model thinks: none turns reasoning off; low/medium/high set the effort. Omit to use the model's default.

Example:

"high"

stop

Up to 4 sequences at which generation stops.

stream
boolean

Stream tokens as Server-Sent Events.

stream_options
object
seed
integer

Best-effort deterministic sampling seed.

n
integer

Number of choices to generate.

frequency_penalty
number
Required range: -2 <= x <= 2
presence_penalty
number
Required range: -2 <= x <= 2
logit_bias
object
logprobs
boolean
top_logprobs
integer
Required range: 0 <= x <= 20
response_format
object

Set to { "type": "json_object" } to force valid JSON output, or { "type": "json_schema", "json_schema": { ... } } for a schema (model-dependent).

tools
object[]

Function/tool definitions the model may call.

tool_choice

Controls tool use: "auto", "none", "required", or a specific tool.

Available options:
none,
auto,
required
parallel_tool_calls
boolean
user
string

An opaque identifier for your end user.

include_deepshi_system_prompt
boolean
default:true

Whether Deepshi may prepend its own tuned system prompt alongside the specified system prompt. Defaults to true

Response

A chat completion. When stream: true, the response is instead an SSE stream of ChatCompletionChunk events terminated by data: [DONE].

id
string
object
string
Example:

"chat.completion"

created
integer<int64>
model
string

The model id you requested (the bare public id).

Example:

"gpt-4o"

choices
object[]
usage
object

Token usage and the billed cost for the request.

system_fingerprint
string