1. Configure your base URL and key
Configure your API client to point to our dedicated endpoint. Use the base URL https://api.llminferencecost.com/v1 and pass your API key in the Authorization header. This setup ensures compatibility with any standard OpenAI SDK. Your key is generated immediately after signing up with Google or an email address.
2. Send your first chat completion
Send your first request using the /v1/chat/completions endpoint. The model ID is uncensored. This model answers without content refusals for lawful adult use. You only pay for tokens consumed, with input at $0.15 per million tokens and output at $0.50 per million tokens. Errors are free.
3. Handle streaming responses
Enable streaming to receive tokens as they are generated. This approach provides a smoother user experience for chat applications. Set the stream parameter to true in your request body. The final chunk of the stream contains the total token usage statistics for billing purposes.
4. Use tools and function calling
Leverage function calling to integrate external tools with your LLM. Define your tools in the request and let the model decide when to invoke them. This feature supports standard JSON schema definitions. It works seamlessly with our uncensored model for complex task automation.
5. Force JSON output mode
Ensure structured data output by setting the response_format to {"type": "json_object"}. This mode is ideal for applications requiring consistent data parsing. It reduces the need for post-processing regex patterns. The model adheres to this constraint strictly when requested.
6. Limits, errors, and context window
Our API supports a context window of 100,000 tokens. You are limited to 300 requests per minute and 8 concurrent requests per key. Requests exceeding 8 MB in body size will be rejected. Common errors include 401 for invalid keys, 402 for insufficient prepaid credit, and 429 for rate limits. Credit never expires.
cURL
curl https://api.llminferencecost.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Summarize the provided JSON log entries for errors only"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.llminferencecost.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.llminferencecost.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);Streaming
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)