ko ▾
키를 생성

Uncensored API, 당신의 방식.

https://api.mistralapikeys.com/v1

개발자를 위한 통합 가이드

기본 URL을 교체하여 기존 스택에 uncensored LLM을 추가하세요. 이 가이드는 인증, 응답 스트리밍 및 OpenAI 호환 API를 사용한 토큰 비용 관리 방법을 정확히 다룹니다.

인증 및 Base URL

대시보드에서 키를 생성하세요. 당사 서비스에는 HTTPS://api.mistralapikeys.com/v1의 베이스 URL이 필요합니다. Authorization 헤더에 Bearer 토큰으로 키를 전달하세요. 전화번호 확인 없이 Google 또는 이메일로 가입할 수 있습니다.

curl https://api.mistralapikeys.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Convert the python loop to rust syntax"}]
  }'

Chat Completions 엔드포인트

POST 요청을 /v1/chat/completions으로 보내고 텍스트 생성을 위해 모델 ID "uncensored"를 사용합니다. 시스템은 역할과 콘텐츠 필드가 있는 표준 메시지 배열을 허용합니다. 입력 토큰은 1M당 $0.15, 출력 토큰은 1M당 $0.50입니다.

from openai import OpenAI

client = OpenAI(base_url="https://api.mistralapikeys.com/v1", api_key="YOUR_KEY")

resp = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Summarise this thread without softening it."}],
)
print(resp.choices[0].message.content)

스트리밍 응답 및 토큰 수

stream을 true로 설정하여 스트리밍을 활성화합니다. API는 부분 청크를 포함하는 서버 전송 이벤트를 반환합니다. 마지막 청크에는 정확한 과금을 위한 전체 토큰 사용량 통계가 포함됩니다. 이 접근 방식은 긴 출력의 지각된 지연 시간을 줄입니다.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.mistralapikeys.com/v1", apiKey: process.env.API_KEY });

const resp = await client.chat.completions.create({
  model: "uncensored",
  messages: [{ role: "user", content: "Draft a villain monologue for my game." }],
});
console.log(resp.choices[0].message.content);

스트리밍

stream = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Tell the story in second person."}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

몇 초 만에 키를 받으세요.

가입, 키 복사, 기본 URL 업데이트. 완료되었습니다.

키를 생성문서 보기