API Documentation
API Reference
Complete reference for interacting with the Chat API
Chat CompletionsPOST
Create a chat completion response for the given conversation
Endpoint
POST https://uncensored.chat/api/v1/chat/completionsHeaders
AuthorizationBearer YOUR_API_KEYContent-Typeapplication/jsonRequest Parameters
modelrequiredstringThe model to use for completion. E.g., "uncensored-v2"
messagesrequiredarrayArray of message objects. Each message has a "role" (user/assistant/system) and "content".
streamoptionalbooleanWhether to stream partial progress. Default: false
temperatureoptionalnumberSampling temperature between 0 and 2. Higher values make output more random.
max_tokensoptionalintegerMaximum number of tokens to generate in the completion.
Request Example
{
"model": "uncensored-v2",
"messages": [
{
"role": "user",
"content": "tell me a big story"
}
],
"stream": true,
"temperature": 0.7,
"max_tokens": 1000
}Response Examples
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1728345600,
"model": "uncensored-v2",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Here's a big story for you..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 150,
"total_tokens": 160
}
}Code Examples
curl -X POST https://uncensored.chat/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "uncensored-v2",
"messages": [
{
"role": "user",
"content": "tell me a big story"
}
],
"stream": true
}'Response Codes
HTTP status codes returned by the API
200OK
Request successful400Bad Request
Invalid request parameters401Unauthorized
Invalid or missing API key429Rate Limited
Too many requests500Server Error
Internal server error