Docs ChatGPT Chat /v1/chat/completions
API reference

Create chat

Unified OpenAI compatible portal. Select the upstream via model, for example: - gpt-4o / gpt-4o-audio-preview → OpenAI - gemini-2.5-flash-all → Google Gemini (compatible format) - For other models see GET /v1/models…

POST/v1/chat/completions

Body Parametersapplication/json

model* string

The model ID to use. The gateway will select channels by token grouping, and may do model name mapping or suffix resolution (such as -thinking, -search).

messages* array

List of conversation messages, at least one. Supports multiple rounds: system/user/assistant/tool.

stream boolean

Whether to stream output. false: Return the complete JSON at once; true: SSE incremental push, ending with data: [DONE].

stream_options

Additional options when streaming, such as whether to return the token usage at the end of the stream.

max_tokens integer

The maximum number of tokens generated in this reply (common fields).

max_completion_tokens integer

Complete the upper limit of token (more commonly used in inference models such as o series and GPT-5). Max_tokens may be inherited when not set.

temperature number

Sampling temperature, usually 0~2. The higher the value, the more random the response is, and the lower the value, the more stable it is. Usually only one is adjusted with top_p.

top_p number

Kernel sampling, 0~1. Only sample tokens whose cumulative probability reaches top_p.

n integer

Generate several assistant reply candidates for the same round of input.

stop

Stop generation when these strings are encountered. Can be a single string or an array of strings (up to 4).

presence_penalty number

There is a penalty, about -2~2. Positive value reduces repetition of topic expressions that have already appeared.

frequency_penalty number

Frequency penalty, about -2~2. Positive values ​​reduce the probability of repeating the same words.

logit_bias object

Adjust the occurrence probability according to the token ID, and the value is a mapping object between -100 and 100.

seed number

Random seeds, try to get reproducible results under the same parameters (complete consistency is not guaranteed). Note that the field is named seed.

user string

The unique identifier of the end user facilitates abuse detection and statistics on the platform side.

response_format

Constrain model output formats, such as JSON schema. When using json_object please explicitly request JSON output in the message.

tools array

A list of tools (functions) that the model can call, used for function calling in conversations.

tool_choice

Control whether to call the tool: none (not called), auto (automatic), required (must be called), or specify a function.

parallel_tool_calls boolean

Whether to allow multiple tool calls to be made in parallel in a single reply (when supported by upstream).

reasoning_effort string

Inference model strength (such as low / medium / high). It can also be automatically injected by the gateway through the model name suffix.

enable_thinking boolean

Whether to enable thinking mode (extension of this warehouse). Only the Boolean value true takes effect; choose one of extra_body.enable_thinking.

extra_body object

Dialog extension parameters. Commonly used: enable_thinking; some Gemini models can use google.thinking_config, etc. Whether it takes effect depends on the channel and model.

web_search_options

Search options for models that support networking (such as OpenAI networking class capabilities).

Responses

200 application/json
response-200 object
properties
choices* array

List of candidate results

created* integer

Creation time (Unix timestamp)

id* string

Resource or task ID

model* string

Model name / model ID

object* string

Object type identifier, e.g. chat.completion

service_tier* string

Service tier / priority

system_fingerprint* string

Backend configuration fingerprint

usage* object

Token usage statistics

400 Bad request or validation failed application/json
response-400 object
properties
error* object
401 Missing or invalid API Key application/json
response-401 object
Request Body Example Create chat
1{
2"model": "gpt-4o",
3"messages": [
4{
5"role": "system",
6"content": "你是一个乐于助人的猫娘。"
7},
8{
9"role": "user",
10"content": "帮我总结一下HTTP是什么。"
11}
12]
13}
Code Sample cURL
1curl -X POST "https://api.digislash.com/v1/chat/completions" \
2-H "Authorization: Bearer <API Key>" \
3-H "Content-Type: application/json" \
4-d '{
5"model": "gpt-4o",
6"messages": [
7{
8"role": "system",
9"content": "你是一个乐于助人的猫娘。"
10},
11{
12"role": "user",
13"content": "帮我总结一下HTTP是什么。"
14}
15]
16}'
Response
1▼{
2"id": "chatcmpl-Dk413e7APldPf4BwB44tzOyNKBHV0",
3"object": "chat.completion",
4"created": 1779870897,
5"model": "gpt-4o",
6▼"choices": [
7▶{ 4 keys }
8],
9▼"usage": {
10"prompt_tokens": 23,
11"completion_tokens": 264,
12"total_tokens": 287,
13▶"prompt_tokens_details": { 2 keys },
14▶"completion_tokens_details": { 4 keys },
15▶"latency_checkpoint": { 9 keys }
16},
17"system_fingerprint": "fp_af7f7349a4",
18"service_tier": "default"
19}