EN ▾

Uncensored API. No refusals. Crypto only.

Llama ai api: Quickstart Guide

You need an uncensored model that ignores content filters without complex setup. This guide shows you how to connect your code to our open-weight LLM using standard OpenAI-compatible endpoints.

Authentication & Base URL

Connect by updating your client configuration to point at our dedicated endpoint. Your API key authenticates every request, so keep it secure but accessible to your application.

The base URL is HTTPS://api.llamaaiapi.com/v1. You do not need to modify headers beyond the standard Authorization header. Our system validates your credentials instantly. If your key is missing or expired, the server returns a 401 error. A 402 response means your prepaid credit is exhausted. A 429 response indicates you have hit the rate limit of 300 requests per minute.

Remember that credit is prepaid via crypto only. There are no monthly subscriptions. Your credit never expires, so you can pause usage indefinitely.

The Chat Completions Endpoint

Send your first request to the chat completions endpoint to receive text output. Use the model id "uncensored" to access our specific open-weight model. It is not GPT, Claude, or any other vendor's model.

The endpoint accepts standard JSON payloads. You provide a system prompt and user messages. The model returns a completion. This is a text-in, text-out interface. There are no embeddings, images, or audio generated here.

Configure your request with the necessary parameters. The model supports a context window of 100,000 tokens. This includes both the input prompt and the output completion. Max output is 16,000 tokens per request.

Python SDK Integration

Use the official OpenAI Python library to interact with our API. It requires minimal configuration changes. You simply set the base URL and provide your API key.

Initialize the client with your key. Set the base URL to our endpoint. Pass your messages to the chat.completions.create method. The library handles the serialization and response parsing.

Node SDK Integration

Integrate with your Node.js application by installing the OpenAI package. Configure the client to use our base URL. This allows you to use familiar methods in your JavaScript or TypeScript code.

Set the apiKey and baseURL properties. Call the chat.completions.create function. The response contains the generated text. You can handle errors gracefully within your async functions.

Streaming Responses via SSE

Enable streaming for real-time token generation. This is useful for chat interfaces that display text as it is produced. The server sends Server-Sent Events (SSE) for each chunk.

Set the stream parameter to true in your request. Iterate over the response chunks. Concatenate the content to build the final message. The last chunk contains the token usage statistics.

JSON Mode and Parameters

Request structured output by setting the response_format to json_object. This forces the model to return valid JSON. Use parameters like temperature and top_p to control creativity. The stop parameter allows you to define termination sequences.

Function calling is also supported. You can define tools and let the model choose to call them. This expands the utility of the uncensored model for complex tasks.

cURL

curl https://api.llamaaiapi.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Show me a list of 5 recent server errors."}]
  }'

Python

from openai import OpenAI

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

Frequently asked questions

What is the llama AI API rate limit?

You are limited to 300 requests per minute per key. You can have up to 8 concurrent requests. Each request body must be under 8 MB.

How much context does the uncensored model support?

The model supports a 100,000 token context window. This includes both the input prompt and the output completion. The maximum output per request is 16,000 tokens.

Is the llama AI API free?

It is not free, but it is prepaid. You pay $0.15 per 1M input tokens and $0.50 per 1M output tokens. Errors and refusals are free.

Get your key now

Sign up, copy the key, update the base URL. Done.

Create key