Konfiguracja uwierzytelniania
Zacznij od wygenerowania swojego klucza na Pobierz klucz API strony. Możesz zalogować się przez Google lub użyć adresu e-mail i hasła; nie jest wymagany numer telefonu. Twój klucz pojawia się natychmiast. Użyj go w Authorization nagłówek dla wszystkich żądań. Dozwolony jest jeden aktywny klucz na konto. Nowy klucz natychmiast zastępuje stary.
POST /v1/chat/completions
Wyślij żądania tekstowe do endpointu uzupełnień czatu. Bazowy URL to HTTPS://api.proxyclaudecode.com/v1. Użyj ID modelu "uncensored" dla bezpośredniego dostępu. Ten endpoint obsługuje tekst wejściowy i wyjściowy. Nie obsługuje embeddingów, obrazów ani dostrajania. Możesz dostosować parametry takie jak temperature i top_p. Błędy i odmowy nie zużywają kredytu.
cURL
curl https://api.proxyclaudecode.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Parse this CSV and return JSON"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.proxyclaudecode.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.proxyclaudecode.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);Strumieniowanie
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)