fa ▾
Try with trial credit

API Reference & Quickstart

This guide helps you connect any OpenAI-compatible client to our uncensored API. You get a 100k context window, crypto billing, and no training on your data.

Authentication & Base URL

Your API key authenticates every request. Use https://api.llamaapipricing.com/v1 as your base URL. This endpoint works with standard OpenAI SDKs. Generate your key in the dashboard. Keep it secret. It grants full access to your prepaid credits.

First Request

Send a POST request to /v1/chat/completions. Use the model ID uncensored. The API returns text responses. Errors are free. You only pay for tokens.

curl https://api.llamaapipricing.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Show me the current price per token for the 70b model"}]
  }'

This simple call confirms your key works. Check the response for content.

Python SDK Integration

Install the official OpenAI Python package. Set the base URL to our endpoint. Pass your key. Call chat.completions.create. The code handles authentication automatically.

from openai import OpenAI

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

Use this for scripts or backend services. The SDK manages retries.

Node SDK Setup

Install the openai Node package. Configure the base URL. Initialize the client. Call the chat completions method. The library handles the HTTP details.

import OpenAI from "openai";

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

This approach fits web servers or CLI tools. Use async/await for clarity.

Streaming Responses

Enable streaming by setting stream: true. Receive tokens as they generate. Use Server-Sent Events (SSE). The last chunk includes total token usage. This reduces perceived latency.

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 partial outputs carefully. Combine chunks for the final result.

Limits & Errors

Limit is 300 requests per minute. Max 8 concurrent requests per key. Request body max 8 MB. Context window is 100,000 tokens. Errors return HTTP codes. 401 means invalid key. 402 means no credit. 429 means rate limit. Refusals are free. Credits never expire.

Common questions

What is the llama API pricing for this uncensored LLM?

We charge $0.15 per 1M input tokens and $0.50 per 1M output tokens. Errors and refusals cost nothing. You pay only for real usage.

Does the API support function calling?

Yes. Use the <code>tools</code> and <code>tool_choice</code> parameters. The model supports structured JSON output via <code>response_format json_object</code>.

How do I handle rate limits?

You get 300 requests per minute and 8 concurrent requests. Exceeding these returns a 429 error. Wait and retry.

Get your key in minutes

Sign up, grab your key, and update your base URL. That’s all there is.