Skip to main content

Uncensored Completions

Overview

Uncensored completion is an OpenAI compatible API that allows you to create chat conversation and get responses based on the conversation. It is very flexible such that it could answer any question without restriction of answer. You can also use openAI sdk to interact with it. Just like OpenAI, this endpoint uses Bearer token authentication.

Request

curl -X POST https://modelslab.com/api/uncensored-chat/v1/completions \
-H "Authorization: Bearer $MODELSLAB_API_KEY" \
-H "Content-Type: application/json"

OpenAI SDK

This endpoint offers compatibility with the OpenAI SDKs to support developers and their apps with minimal changes. Once you update the base URL, you can start using the SDKs to make calls to Modelslab with API key.

Attributes

ParameterTypeDescription
promptArrayprompts to be used for completion.
max_tokensIntThe maximum number of tokens (words or characters) allowed in the response.

Example

Body

Body Raw
{
"prompt": "Write a tagline for an ice cream shop.",
"model": ""
}

Request

You can import the OpenAI client from openai into your javascript application and change the base URL and API key.

import OpenAI from "openai";
const openai = new OpenAI({
apiKey: "<api key>",
baseURL: "https://modelslab.com/api/uncensored-chat/v1",
});

const completion = await openai.chat.completions.create({
model: "ModelsLab/Llama-3.1-8b-Uncensored-Dare",
prompt: "Write a tagline for an ice cream shop.",
});

console.log(completion.choices[0].text);


Response

{
"object": "text_completion",
"created": 1732624363,
"model": "ModelsLab/Llama-3.1-8b-Uncensored-Dare",
"choices": [
{
"text": "\"Indulge in our destructive addiction of ice cream.\"",
"index": 0,
"logprobs": null,
"finish_reason": "length",
"stop_reason": null,
"prompt_logprobs": null
}
],
"usage": {
"prompt_tokens": 122,
"completion_tokens": 13,
"total_tokens": 135
}
}