Claude precio: quickstart and API reference
This guide helps you integrate our uncensored, open-weight model using standard OpenAI SDK clients without changing your code. We provide a direct, proxy-style alternative to expensive vendor models by offering an uncensored, open-weight model via the exact same chat-completions endpoint.
Installation and environment setup
Start by installing the official client library for your language. Our service sits behind the standard /v1 path, so you only need to update the base URL and API key. The base URL on this site is HTTPS://api.claudeprecio.com/v1. Authentication relies on a single active key per account. You can generate this key immediately via Google or email on the "Get API key" page. No phone number is required. The key is shown once, so copy it securely.
Making your first request with Python
Send a completion request using the standard Python SDK. Point the client to our base URL and set the model to "uncensored". This open-weight model runs on our own servers and is tuned to answer without content refusals. You can pass parameters like temperature or top_p just as you would with any OpenAI-compatible service. The request structure remains identical to the standard format.
from openai import OpenAI
client = OpenAI(base_url="https://api.claudeprecio.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)
Verify the response contains the generated text. If you receive a 401 error, your key is invalid. A 402 error indicates insufficient prepaid credit. Errors during generation do not consume tokens, so you only pay for successful output.
Streaming responses and usage tracking
Enable streaming by setting stream=True in your client configuration. The API returns Server-Sent Events (SSE) for each token generated. This allows you to display text in real time while waiting for the full response. Usage data, including input and output token counts, is included in the final chunk of the stream. This approach reduces perceived latency for long outputs. It works seamlessly with the standard SDKs.
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)
Handle stream interruptions gracefully. Network drops may leave partial responses. Always check the final chunk for accurate token usage statistics. This ensures your billing dashboard matches actual consumption.
Parameters: temperature, top_p, and seed
Control creativity and reproducibility using standard generation parameters. The temperature value adjusts randomness, with lower values producing more deterministic outputs. Use top_p to limit sampling to the top probability mass. Set seed to fix the random state for reproducible results across multiple calls. These parameters work identically to the OpenAI standard. Adjust them based on your use case, whether it is coding or creative writing.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.claudeprecio.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);
Combine these settings for precise control. For example, a low temperature with a fixed seed ensures consistent outputs for testing. The model supports all standard parameters like stop sequences and presence_penalty. Experiment to find the right balance for your specific project.
Function calling and JSON mode
Use function calling to integrate the API into your applications. Define tools in the request body, and the model will return structured JSON containing function arguments. Enable JSON mode by setting response_format to {"type": "json_object"}. This ensures the output is always valid JSON, which simplifies parsing. Use this for data extraction or structured responses. The model handles complex tool definitions efficiently.
curl https://api.claudeprecio.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Calculate total cost for 10 million input tokens and 3 million output tokens"}]
}'
Test function calling with a simple tool definition. Verify the model respects the tool schema. JSON mode is particularly useful when you need predictable output structures. Combine it with streaming for real-time data processing. This feature makes the API suitable for production-grade applications.
Limits, errors, and context window
The context window supports 100,000 tokens for prompt and completion combined. The maximum output per request is 16,000 tokens. If max_tokens is unset, the limit defaults to 2,048. You are allowed 300 requests per minute per key. Concurrency is limited to 8 simultaneous requests per key. The request body must not exceed 8 MB. Errors like 401, 402, and 429 are handled via standard HTTP status codes. Token usage is billed accurately, and errors are free.
Frequently asked questions
How much does the uncensored API cost?
Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens. Credit is prepaid and charged by real token usage. Errors and refusals do not consume credit.
What is the context window size?
The context window is 100,000 tokens for prompt and completion together. You can output up to 16,000 tokens per request. The default max output is 2,048 tokens if not specified.
Can I use this with the standard OpenAI SDK?
Yes, it is fully OpenAI-compatible. You only need to change the base URL to HTTPS://api.claudeprecio.com/v1 and set the model to "uncensored". All standard parameters and features like streaming and function calling work as expected.
Get your API key now
Register, copy the key, update the base URL. That is all you need to do.