Skip to main content
POST
/
v1
/
chat
/
completions
Create chat completion
curl --request POST \
  --url https://api.mulerun.com/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "gpt-5",
  "messages": [
    {
      "role": "user",
      "content": "Hello! How are you?"
    }
  ]
}'
{
  "id": "chatcmpl-fJ5wOo5nqnWz2Z9jkF4NK",
  "object": "chat.completion",
  "created": 1715392980,
  "model": "gpt-5",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How are you?",
        "refusal": null,
        "annotations": []
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 10,
    "total_tokens": 20,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "audio_tokens": 0
    },
    "completion_tokens_details": {
      "cached_tokens": 0,
      "audio_tokens": 0,
      "accepted_prediction_tokens": 0,
      "rejected_prediction_tokens": 0
    }
  }
}
This API is compatible with OpenAI’s format.For more details, please refer to OpenAI’s official documentation.

Authorizations

Authorization
string
header
required

Body

application/json
messages
(Developer message · object | System message · object | User message · object | Assistant message · object | Tool message · object | Function message · object)[]
required
Minimum length: 1
  • Developer message
  • System message
  • User message
  • Assistant message
  • Tool message
  • Function message
model
string
required
Example:
modalities
enum<string>[] | null
verbosity
enum<string> | null
Available options:
low,
medium,
high
reasoning_effort
enum<string> | null
Available options:
minimal,
low,
medium,
high
max_completion_tokens
integer | null
frequency_penalty
number | null
Required range: -2 <= x <= 2
presence_penalty
number | null
Required range: -2 <= x <= 2
web_search_options
object
top_logprobs
integer
Required range: 0 <= x <= 20
response_format
object
  • Text
  • JSON schema
  • JSON object
audio
object | null
store
boolean | null
stream
boolean | null
stop
Example:
logit_bias
object | null
logprobs
boolean | null
max_tokens
integer | null
deprecated
n
integer | null
Required range: 1 <= x <= 128
Example:
prediction
object
seed
integer | null
deprecated
Required range: -9223372036854776000 <= x <= 9223372036854776000
stream_options
object | null
tools
(Function tool · object | Custom tool · object)[]
  • Function tool
  • Custom tool
tool_choice
Available options:
none,
auto,
required
parallel_tool_calls
boolean
function_call
deprecated
Available options:
none,
auto
functions
object[]
deprecated
Required array length: 1 - 128 elements
metadata
object | null
temperature
number | null
Required range: 0 <= x <= 2
Example:
top_p
number | null
Required range: 0 <= x <= 1
Example:
user
string
deprecated
Example:
service_tier
enum<string> | null
Available options:
auto,
default,
flex,
scale,
priority

Response

id
string
required
choices
object[]
required
created
integer
required
model
string
required
object
enum<string>
required
Available options:
chat.completion
service_tier
enum<string> | null
Available options:
auto,
default,
flex,
scale,
priority
system_fingerprint
string
deprecated
usage
object