Authentication
Authentication is handled via a single API key. You can sign up using Google or an email password on the Get API key page. The key is displayed immediately and is tied to your prepaid credit. Unlike major vendors, there are no monthly subscriptions or credit cards required for the trial. Use the header Authorization: Bearer YOUR_API_KEY for all requests. Your key is the only active credential per account; generating a new key invalidates the previous one.
Basic Completion
Send a standard chat completion request to the OpenAI-compatible endpoint. The model identifier is uncensored. This model is open-weight and tuned to answer without content refusals for lawful adult use. It is not GPT, Claude, or any other vendor model. The base URL for this service is provided below.
curl https://api.ornith.top/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."}]
}'Replace YOUR_API_KEY with your key from the dashboard. The response includes the generated text in choices[0].message.content. Errors like 401 indicate an invalid key, while 402 means your prepaid credit is exhausted.
Python SDK
Use the official openai Python package. Point it to the Ornith base URL and provide your API key. This ensures compatibility with the standard OpenAI client structure. You can pass messages as a list of dictionaries containing role and content. The client handles the HTTP requests automatically. This approach works for both simple text generation and more complex interactions using tools or JSON mode.
from openai import OpenAI
client = OpenAI(base_url="https://api.ornith.top/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)The response object mirrors the standard OpenAI structure. You can access the generated text directly from the response object. This method is ideal for backend services or scripts where you need programmatic access to the model's output.
Node SDK
Install the openai npm package. Initialize the client with the Ornith base URL and your API key. The structure of the request is identical to the Python SDK. Use the chat.completions.create method. This is suitable for JavaScript environments, whether you are building a web backend or a CLI tool. The client handles serialization and deserialization of the response.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.ornith.top/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);Handle errors appropriately. Network errors or API errors will throw exceptions. Check the status code to distinguish between authentication failures, rate limits, or server errors. The response contains the completion details in the same format as the Python SDK.
Streaming Responses
Enable streaming by setting stream: true in your request. This returns a stream of tokens as they are generated. Use this for real-time UI updates or progressive text display. The stream ends with a final chunk that contains the total token usage. This allows you to track costs in real-time without waiting for the full response. It is efficient for long contexts where you want to show progress.
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)Iterate over the stream to process each chunk. The last chunk includes the usage field. This is useful for billing transparency. Ensure your client handles the stream correctly to avoid memory issues with large responses.
Limits, Errors & Context
The context window is 100,000 tokens for prompt and completion combined. The maximum output per request is 32,000 tokens (2,048 if max_tokens is unset). You are limited to 300 requests per minute and 8 concurrent requests per key. Request bodies must be under 8 MB. If you exceed the rate limit, you receive a 429 error. Refusals for minor-related content are hard-coded and always apply. Errors do not consume credit. Credit is prepaid and never expires.