pl ▾
Claim trial key

Claude proxy api documentation

Get started with an uncensored LLM API in seconds. This guide shows how to send requests using your prepaid crypto credit and standard OpenAI-compatible clients.

Authentication and base URL

Start by obtaining your API key from the dashboard. Use the base URL https://api.claudeproxyapi.com/v1 with your key in the authorization header. This setup works with any OpenAI-compatible client by updating the base URL and API key.

curl https://api.claudeproxyapi.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "fetch status of job 42"}]
  }'

The endpoint serves a single uncensored model. You do not need to manage model routing or proxy configurations. Just send requests directly to the hosted service.

Chat Completions endpoint

Send text generation requests to the chat completions endpoint. The base URL points to the hosted service. You must specify the model ID as uncensored in your request body. This model answers without content refusals for lawful adult use.

from openai import OpenAI

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

The API accepts standard parameters like temperature and top_p. It returns text responses directly. No embeddings or vision processing are available. Keep your requests simple to ensure fast processing.

Streaming responses and token usage

Enable streaming by setting the stream parameter to true. The API returns Server-Sent Events for real-time token delivery. Token usage details appear in the final chunk of the stream. This allows you to track costs accurately as the response generates.

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)

Streaming reduces perceived latency for long outputs. You can start processing tokens immediately. The final chunk contains the total input and output token counts. Use these numbers to monitor your prepaid credit usage.

Function calling and JSON mode

Use function calling to integrate external tools. Define your tools in the message structure and set the tool choice parameter. The model returns structured arguments for your functions. This works alongside standard text generation.

import OpenAI from "openai";

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

Enable strict JSON mode by setting the response format to json_object. The model outputs valid JSON without markdown code blocks. This is ideal for programmatic pipelines. Ensure your parser handles the raw output correctly.

Parameters: temperature, top_p, stop, seed

Control creativity with the temperature parameter. Higher values increase randomness. Lower values make outputs more deterministic. Use top_p to limit token selection probability. The stop parameter halts generation at specific sequences. Set the seed for reproducible results.

These parameters fine-tune the output style. Adjust them based on your use case. Coding tasks often benefit from low temperature. Creative writing may require higher values. Test different combinations to find your preferred balance.

Error handling and rate limits

Handle errors gracefully using standard HTTP status codes. A 401 error means your API key is invalid. A 402 error indicates insufficient prepaid credit. A 429 error signals that you have hit the rate limit of 300 requests per minute.

The context window allows 100,000 tokens total. This includes both prompt and completion tokens. You can request up to 16,000 tokens in a single output. Requests exceeding these limits will fail. Monitor your usage to avoid unexpected interruptions.

Frequently asked questions

What is the claude proxy API context window limit?

The context window supports 100,000 tokens for both prompt and completion combined. You can generate up to 16,000 tokens in a single request. If you do not set max_tokens, the default output length is 2,048 tokens.

How do I handle 402 errors with this uncensored model API?

A 402 error means your prepaid credit is exhausted. You must top up using USDT or USDC to continue using the API. Credit never expires, so you can add funds at any time without losing your balance.

Is this an official OpenAI API alternative?

It is an OpenAI-compatible API that uses a different base model. The endpoint structure matches the OpenAI standard, so you can use existing SDKs. The model ID is <code>uncensored</code>, not a specific vendor name. Check the pricing page for current token rates.

Get your key in minutes

Register, copy your key, update the endpoint. Done.

Claim trial key