Skip to main content

Uncensored Completions

Overview

The Uncensored Completions endpoint generates responses based on provided prompts without restrictions. It supports OpenAI SDKs and 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.

Body Attributes

ParameterDescriptionValues
promptPrompts to be used for generating completions.Array
max_tokensThe maximum number of tokens (words or characters) allowed in the response.Integer (Default: 128, Max: 30000)

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
}
}