ko ▾
키를 받으세요

빠른 시작: 무제한 모델 통합

표준 OpenAI 인터페이스를 사용하여 몇 분 안에 무검열 LLM을 통합하세요. 이 가이드는 SDK 설정, 스트리밍 및 구조화된 출력을 다루어 즉각적인 배포를 가능하게 합니다.

키를 받으세요

1M 입력 토큰당
$0.15
출력 토큰 / 100만 개
$0.50
토큰 컨텍스트
100,000
트라이얼 크레딧
$0.50
분당 요청 수
300

공식 SDK 설치

환경에 라이브러리를 추가하는 것으로 시작하세요. 공식 패키지는 엔드포인트와 직접 작동합니다. 선호하는 패키지 매니저를 사용하여 종속성을 설치하세요. 이는 API 호출에 대한 최신 호환성을 보장합니다.

설치하면 연결 매개변수를 구성할 준비가 됩니다. 설정 과정은 시간이 아닌 몇 초가 걸립니다.

base_url 및 api_key 설정

클라이언트를 전용 서버로 연결하세요. 기본 베이스 URL을 저희 특정 엔드포인트로 교체하세요. 대시보드에서 생성한 키를 사용하세요. 인증은 표준 Bearer 헤더를 통해 처리됩니다.

키는 안전하게 보관하세요. 이 키는 선불 크레딧에 대한 접근 권한을 부여합니다. URL 구조는 이미 알고 있는 표준 형식을 따릅니다.

첫 번째 채팅 완성 보내기

chat completions 엔드포인트로 POST 요청을 보내세요. 시스템 프롬프트와 사용자 메시지를 전달하세요. 모델이 텍스트를 즉시 반환합니다. 이는 연결이 활성화되어 있고 크레딧이 올바르게 차감되었음을 확인합니다.

에러는 표준 HTTP 코드를 반환합니다. 응답 본문에서 세부 정보를 확인하세요. 이 단계는 통합이 기능적인지 확인합니다.

cURL

curl https://api.apiaiunlimited.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "list the endpoints for the chat completion endpoint"}]
  }'

Python

from openai import OpenAI

client = OpenAI(base_url="https://api.apiaiunlimited.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)

Node.js

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.apiaiunlimited.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)

API 키 보안

등록하고, 키를 가져온 후 엔드포인트를 교체하세요. 전체 설정입니다.

키를 받으세요