EN ▾
Get API key

Quickstart for Ltx pipelines

Integrate the Ltx API into your pipeline by pointing your OpenAI-compatible SDK to our base URL. Use the uncensored 'uncensored' model for text completion, function calling, and structured JSON outputs without content refusals.

Base URL and Authentication

Configure your client to target https://api.ltxapi.cc/v1. Authentication relies on a single API key per account, generated via the dashboard using Google or email credentials. Pass this key in the Authorization header as a bearer token. Unlike services offering multiple keys, this API enforces one active key per account; generating a new key immediately revokes the previous one. This simplifies key rotation and audit trails for automation pipelines.

First Request

Send a standard chat completion request to test connectivity and token pricing. The endpoint accepts standard OpenAI payload structures. Ensure you specify the model ID as "uncensored" to access the tuned model. The API returns raw text responses without filtering lawful adult or controversial topics, making it suitable for creative writing or data extraction tasks where refusals are common.

curl https://api.ltxapi.cc/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
  }'

Python SDK Integration

Use the official OpenAI Python library by overriding the base URL. This ensures compatibility with existing codebases while leveraging the Ltx uncensored model. Initialize the client with your API key and the custom base URL. This approach allows you to use standard methods like chat.completions.create without rewriting your integration logic. The SDK handles serialization and response parsing automatically.

from openai import OpenAI

client = OpenAI(base_url="https://api.ltxapi.cc/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 SDK Integration

For JavaScript environments, configure the OpenAI Node SDK to point to our base URL. This enables seamless integration into Node.js pipelines for serverless functions or backend services. Set the apiKey and baseURL properties during initialization. The SDK supports standard completion calls, allowing you to replace OpenAI's endpoint with the Ltx API for uncensored text generation.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.ltxapi.cc/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 Responses

Enable streaming by setting stream: true in your request. The API returns a Server-Sent Events (SSE) stream of token chunks. Each chunk includes usage statistics in the final event, allowing you to track token consumption in real-time. This is essential for applications displaying text progressively or requiring immediate partial results. Ensure your client handles SSE events correctly to avoid memory leaks.

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)

Rate Limits and Constraints

The API enforces strict limits to ensure stability. Each key is limited to 300 requests per minute and 8 concurrent requests. The maximum request body size is 8 MB. Errors include 401 for invalid keys, 402 for insufficient credit, and 429 for rate limits. Credit is charged only for successful token usage; errors and refusals are free. The context window is 100,000 tokens total, with no separate output cap per request.

API facts in one table

If your tool speaks the OpenAI API, these are the details that matter.

FeatureSupport
CompatibilityOpenAI Chat Completions schema; official openai SDKs work unchanged
EndpointsPOST /v1/chat/completions · GET /v1/models
Modeluncensored
AuthenticationAuthorization: Bearer YOUR_KEY
Base URLhttps://api.ltxapi.cc/v1
Max outputprompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap
StreamingYes — server-sent events; the last chunk carries token usage
Tools / tool callsSupported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages
JSON modeJSON object mode via response_format json_object
Context window100,000 tokens, input and output combined
Sampling parameterstemperature, top_p, stop, seed, presence_penalty, frequency_penalty
Requests per minute300/min per key
Concurrency8 requests at the same time per key
Response headersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Max body8 MB request body
Billingprepaid credit, charged by real token usage; errors and refusals are free
Free trial$0.50 for 7 days, no card · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up
Price$0.15 per 1M input tokens · $0.50 per 1M output tokens
Top-upcrypto: USDT on TRON or USDC on Base, $20–$500, any whole sum
Subscriptionpaid credit never expires, no subscription
Volume bonus+5% on $50+, +10% on $100+, +15% on $200+
Content policyadult content allowed; sexual content involving minors is refused
Accountsign in with Google or with e-mail + password
Key managementone active key per account; a new key replaces the old one

Errors and what to do

Every error is JSON with a type you can switch on. You are never charged for an error.

CodeTypeMeaning
400bad_requestinvalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend
401missing_key · invalid_key · key_revokedno key, wrong key, or a key replaced by a newer one
402no_creditout of credit; add credit and retry
403content_blockedsexual content involving minors — refused, not billed
404not_foundunknown endpoint
413request_too_largebody over 8 MB
429rate_limited · concurrencyslow down: rate or parallel limit reached
503upstream_busymodel busy — retry in a few seconds

Questions and answers

How many API keys can I generate?

You can have only one active API key per account. Generating a new key immediately invalidates the previous one. This design simplifies key management for individual developers and small automation pipelines.

Does the API support function calling?

Yes, the API supports function calling via the tools parameter. You can define tools in the standard OpenAI format, and the model will return structured tool calls in the response. This enables complex workflows where the model triggers external actions based on user input.

What happens if I exceed the rate limit?

The API returns a 429 status code when you exceed 300 requests per minute or 8 concurrent requests. Your credit is not charged for these requests if they are rejected due to rate limits. Implement exponential backoff in your client to handle retries efficiently.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.