Chat Completion
curl --request POST \
--url https://api.uncensoredgpt.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
],
"frequency_penalty": 123,
"logit_bias": {},
"logprobs": true,
"top_logprobs": 123,
"max_tokens": 123,
"n": 123,
"presence_penalty": 123,
"response_format": {},
"seed": 123,
"service_tier": "<string>",
"stop": "<string>",
"stream_options": {},
"temperature": 123,
"top_p": 123,
"tools": [
{}
],
"tool_choice": "<string>",
"parallel_tool_calls": true,
"function_call": "<string>",
"functions": [
{}
],
"user": "<string>",
"stream": true,
"metadata": {},
"guardrails": [
"<string>"
],
"caching": true,
"num_retries": 123,
"context_window_fallback_dict": {},
"fallbacks": [
"<string>"
]
}
'import requests
url = "https://api.uncensoredgpt.ai/v1/chat/completions"
payload = {
"model": "<string>",
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
],
"frequency_penalty": 123,
"logit_bias": {},
"logprobs": True,
"top_logprobs": 123,
"max_tokens": 123,
"n": 123,
"presence_penalty": 123,
"response_format": {},
"seed": 123,
"service_tier": "<string>",
"stop": "<string>",
"stream_options": {},
"temperature": 123,
"top_p": 123,
"tools": [{}],
"tool_choice": "<string>",
"parallel_tool_calls": True,
"function_call": "<string>",
"functions": [{}],
"user": "<string>",
"stream": True,
"metadata": {},
"guardrails": ["<string>"],
"caching": True,
"num_retries": 123,
"context_window_fallback_dict": {},
"fallbacks": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
messages: [{role: 'user', content: 'Hello, how are you?'}],
frequency_penalty: 123,
logit_bias: {},
logprobs: true,
top_logprobs: 123,
max_tokens: 123,
n: 123,
presence_penalty: 123,
response_format: {},
seed: 123,
service_tier: '<string>',
stop: '<string>',
stream_options: {},
temperature: 123,
top_p: 123,
tools: [{}],
tool_choice: '<string>',
parallel_tool_calls: true,
function_call: '<string>',
functions: [{}],
user: '<string>',
stream: true,
metadata: {},
guardrails: ['<string>'],
caching: true,
num_retries: 123,
context_window_fallback_dict: {},
fallbacks: ['<string>']
})
};
fetch('https://api.uncensoredgpt.ai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.uncensoredgpt.ai/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'messages' => [
[
'role' => 'user',
'content' => 'Hello, how are you?'
]
],
'frequency_penalty' => 123,
'logit_bias' => [
],
'logprobs' => true,
'top_logprobs' => 123,
'max_tokens' => 123,
'n' => 123,
'presence_penalty' => 123,
'response_format' => [
],
'seed' => 123,
'service_tier' => '<string>',
'stop' => '<string>',
'stream_options' => [
],
'temperature' => 123,
'top_p' => 123,
'tools' => [
[
]
],
'tool_choice' => '<string>',
'parallel_tool_calls' => true,
'function_call' => '<string>',
'functions' => [
[
]
],
'user' => '<string>',
'stream' => true,
'metadata' => [
],
'guardrails' => [
'<string>'
],
'caching' => true,
'num_retries' => 123,
'context_window_fallback_dict' => [
],
'fallbacks' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.uncensoredgpt.ai/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"frequency_penalty\": 123,\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"max_tokens\": 123,\n \"n\": 123,\n \"presence_penalty\": 123,\n \"response_format\": {},\n \"seed\": 123,\n \"service_tier\": \"<string>\",\n \"stop\": \"<string>\",\n \"stream_options\": {},\n \"temperature\": 123,\n \"top_p\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"function_call\": \"<string>\",\n \"functions\": [\n {}\n ],\n \"user\": \"<string>\",\n \"stream\": true,\n \"metadata\": {},\n \"guardrails\": [\n \"<string>\"\n ],\n \"caching\": true,\n \"num_retries\": 123,\n \"context_window_fallback_dict\": {},\n \"fallbacks\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.uncensoredgpt.ai/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"frequency_penalty\": 123,\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"max_tokens\": 123,\n \"n\": 123,\n \"presence_penalty\": 123,\n \"response_format\": {},\n \"seed\": 123,\n \"service_tier\": \"<string>\",\n \"stop\": \"<string>\",\n \"stream_options\": {},\n \"temperature\": 123,\n \"top_p\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"function_call\": \"<string>\",\n \"functions\": [\n {}\n ],\n \"user\": \"<string>\",\n \"stream\": true,\n \"metadata\": {},\n \"guardrails\": [\n \"<string>\"\n ],\n \"caching\": true,\n \"num_retries\": 123,\n \"context_window_fallback_dict\": {},\n \"fallbacks\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uncensoredgpt.ai/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"frequency_penalty\": 123,\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"max_tokens\": 123,\n \"n\": 123,\n \"presence_penalty\": 123,\n \"response_format\": {},\n \"seed\": 123,\n \"service_tier\": \"<string>\",\n \"stop\": \"<string>\",\n \"stream_options\": {},\n \"temperature\": 123,\n \"top_p\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"function_call\": \"<string>\",\n \"functions\": [\n {}\n ],\n \"user\": \"<string>\",\n \"stream\": true,\n \"metadata\": {},\n \"guardrails\": [\n \"<string>\"\n ],\n \"caching\": true,\n \"num_retries\": 123,\n \"context_window_fallback_dict\": {},\n \"fallbacks\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Chat
Create chat completion
Follows the exact same API spec as OpenAI's Chat API https://platform.openai.com/docs/api-reference/chat
curl -X POST https://api.uncensoredgpt.ai/v1/chat/completions
-H "Content-Type: application/json"
-H "Authorization: Bearer $UNCENSOREDGPT_API_KEY"
-d '{
"model": "uncensoredgpt/qwen3.8-27b-uncensored",
"messages": [
{
"role": "user",
"content": "Hello!"
}
]
}'
POST
/
v1
/
chat
/
completions
Chat Completion
curl --request POST \
--url https://api.uncensoredgpt.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
],
"frequency_penalty": 123,
"logit_bias": {},
"logprobs": true,
"top_logprobs": 123,
"max_tokens": 123,
"n": 123,
"presence_penalty": 123,
"response_format": {},
"seed": 123,
"service_tier": "<string>",
"stop": "<string>",
"stream_options": {},
"temperature": 123,
"top_p": 123,
"tools": [
{}
],
"tool_choice": "<string>",
"parallel_tool_calls": true,
"function_call": "<string>",
"functions": [
{}
],
"user": "<string>",
"stream": true,
"metadata": {},
"guardrails": [
"<string>"
],
"caching": true,
"num_retries": 123,
"context_window_fallback_dict": {},
"fallbacks": [
"<string>"
]
}
'import requests
url = "https://api.uncensoredgpt.ai/v1/chat/completions"
payload = {
"model": "<string>",
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
],
"frequency_penalty": 123,
"logit_bias": {},
"logprobs": True,
"top_logprobs": 123,
"max_tokens": 123,
"n": 123,
"presence_penalty": 123,
"response_format": {},
"seed": 123,
"service_tier": "<string>",
"stop": "<string>",
"stream_options": {},
"temperature": 123,
"top_p": 123,
"tools": [{}],
"tool_choice": "<string>",
"parallel_tool_calls": True,
"function_call": "<string>",
"functions": [{}],
"user": "<string>",
"stream": True,
"metadata": {},
"guardrails": ["<string>"],
"caching": True,
"num_retries": 123,
"context_window_fallback_dict": {},
"fallbacks": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
messages: [{role: 'user', content: 'Hello, how are you?'}],
frequency_penalty: 123,
logit_bias: {},
logprobs: true,
top_logprobs: 123,
max_tokens: 123,
n: 123,
presence_penalty: 123,
response_format: {},
seed: 123,
service_tier: '<string>',
stop: '<string>',
stream_options: {},
temperature: 123,
top_p: 123,
tools: [{}],
tool_choice: '<string>',
parallel_tool_calls: true,
function_call: '<string>',
functions: [{}],
user: '<string>',
stream: true,
metadata: {},
guardrails: ['<string>'],
caching: true,
num_retries: 123,
context_window_fallback_dict: {},
fallbacks: ['<string>']
})
};
fetch('https://api.uncensoredgpt.ai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.uncensoredgpt.ai/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'messages' => [
[
'role' => 'user',
'content' => 'Hello, how are you?'
]
],
'frequency_penalty' => 123,
'logit_bias' => [
],
'logprobs' => true,
'top_logprobs' => 123,
'max_tokens' => 123,
'n' => 123,
'presence_penalty' => 123,
'response_format' => [
],
'seed' => 123,
'service_tier' => '<string>',
'stop' => '<string>',
'stream_options' => [
],
'temperature' => 123,
'top_p' => 123,
'tools' => [
[
]
],
'tool_choice' => '<string>',
'parallel_tool_calls' => true,
'function_call' => '<string>',
'functions' => [
[
]
],
'user' => '<string>',
'stream' => true,
'metadata' => [
],
'guardrails' => [
'<string>'
],
'caching' => true,
'num_retries' => 123,
'context_window_fallback_dict' => [
],
'fallbacks' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.uncensoredgpt.ai/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"frequency_penalty\": 123,\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"max_tokens\": 123,\n \"n\": 123,\n \"presence_penalty\": 123,\n \"response_format\": {},\n \"seed\": 123,\n \"service_tier\": \"<string>\",\n \"stop\": \"<string>\",\n \"stream_options\": {},\n \"temperature\": 123,\n \"top_p\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"function_call\": \"<string>\",\n \"functions\": [\n {}\n ],\n \"user\": \"<string>\",\n \"stream\": true,\n \"metadata\": {},\n \"guardrails\": [\n \"<string>\"\n ],\n \"caching\": true,\n \"num_retries\": 123,\n \"context_window_fallback_dict\": {},\n \"fallbacks\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.uncensoredgpt.ai/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"frequency_penalty\": 123,\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"max_tokens\": 123,\n \"n\": 123,\n \"presence_penalty\": 123,\n \"response_format\": {},\n \"seed\": 123,\n \"service_tier\": \"<string>\",\n \"stop\": \"<string>\",\n \"stream_options\": {},\n \"temperature\": 123,\n \"top_p\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"function_call\": \"<string>\",\n \"functions\": [\n {}\n ],\n \"user\": \"<string>\",\n \"stream\": true,\n \"metadata\": {},\n \"guardrails\": [\n \"<string>\"\n ],\n \"caching\": true,\n \"num_retries\": 123,\n \"context_window_fallback_dict\": {},\n \"fallbacks\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uncensoredgpt.ai/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"frequency_penalty\": 123,\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"max_tokens\": 123,\n \"n\": 123,\n \"presence_penalty\": 123,\n \"response_format\": {},\n \"seed\": 123,\n \"service_tier\": \"<string>\",\n \"stop\": \"<string>\",\n \"stream_options\": {},\n \"temperature\": 123,\n \"top_p\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"function_call\": \"<string>\",\n \"functions\": [\n {}\n ],\n \"user\": \"<string>\",\n \"stream\": true,\n \"metadata\": {},\n \"guardrails\": [\n \"<string>\"\n ],\n \"caching\": true,\n \"num_retries\": 123,\n \"context_window_fallback_dict\": {},\n \"fallbacks\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
An UncensoredGPT API key created in the UncensoredGPT Console.
Body
application/json
messages
(ChatCompletionUserMessage · object | ChatCompletionAssistantMessage · object | ChatCompletionToolMessage · object | ChatCompletionSystemMessage · object | ChatCompletionFunctionMessage · object | ChatCompletionDeveloperMessage · object)[]
required
- ChatCompletionUserMessage
- ChatCompletionAssistantMessage
- ChatCompletionToolMessage
- ChatCompletionSystemMessage
- ChatCompletionFunctionMessage
- ChatCompletionDeveloperMessage
Show child attributes
Show child attributes
Example:
[ { "role": "user", "content": "Hello, how are you?" } ]
Response
Successful Response

