Skip to content

Quickstart

Create a key in the console, then send one request. Keys start with cllm_ and are shown once.

In sandbox mode, successful requests return placeholder replies and are billed at the published token rates.

curl
export COMMENTLLM_API_KEY="cllm_..."
curl https://api.commentllm.com/v1/chat/completions \
-H "Authorization: Bearer $COMMENTLLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "deepseek-v4.1-flash-1017-abliterated", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}]}'

Or keep the SDK you use today and change its base URL.

Python · OpenAI SDK
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.commentllm.com/v1",
api_key=os.environ["COMMENTLLM_API_KEY"],
)
reply = client.chat.completions.create(
model="deepseek-v4.1-flash-1017-abliterated",
max_tokens=1024,
messages=[{"role": "user", "content": "Explain this Sigma rule."}],
)
print(reply.choices[0].message.content)
Python · Anthropic SDK
import os
import anthropic
client = anthropic.Anthropic(
base_url="https://api.commentllm.com",
api_key=os.environ["COMMENTLLM_API_KEY"],
)
reply = client.messages.create(
model="deepseek-v4.1-flash-1017-abliterated",
max_tokens=1024,
messages=[{"role": "user", "content": "Explain this Sigma rule."}],
)
print(reply.content[0].text)

Model requests work as soon as you finish signing up and have credit to spend. There is no review step.

Authentication#

Send the key as Authorization: Bearer cllm_.... The x-api-key header also works. Each key belongs to one project.

Model requests require an accepted Acceptable Use Policy, which you accept when you sign up. Prepaid organizations use their credit balance. Organizations on monthly invoices use their remaining spending limit. If your organization has an IP allowlist, requests from any other address get ip_not_allowed. Keys of an archived project stop working; so do revoked and expired keys.

Each billable request temporarily reserves credit for its input and maximum output. Concurrent requests share the remaining credit. Set an output limit suited to your task. If you omit it on Chat Completions, the gateway uses the model’s maximum. When a request settles, its usage appears in the console and the unused credit becomes available again. An abandoned reservation expires after one hour.

Models#

Choose an abliterated model for authorized security work. Both are in preview and accept text through the API. The context window is shared between input and output; set an output limit appropriate to your task.

ModelAPI model IDContext windowMax outputInputs
DeepSeek V4.1 Flash 1017 Abliterateddeepseek-v4.1-flash-1017-abliterated1,048,576 tokens32,768 tokensText
Qwen 3.8 27B Abliteratedqwen3.8-27b-abliterated262,144 tokens65,536 tokensText

Abliteration reduces model refusal behavior; it does not guarantee that every response will follow a request. Your organization’s policies and engagement scope still apply.

Find a model ID

Use your project key to list the IDs that the gateway accepts. Pass the id from a catalog entry as model in either SDK. Each entry includes the limits and token rates configured for that ID. See pricing for current rates.

curl
curl --fail-with-body https://api.commentllm.com/v1/models \
-H "Authorization: Bearer $COMMENTLLM_API_KEY"

API reference#

MethodPathUse
GET/v1/modelsList models and prices.
POST/v1/chat/completionsOpenAI Chat Completions.
POST/v1/messagesAnthropic Messages.

Chat Completions

  • Accepted: model, messages, stream, max_tokens or max_completion_tokens, temperature, top_p, stop, seed, presence_penalty, frequency_penalty.
  • CommentLLM adds policy_ids: opt-in policies to run on this request (see Policies).
  • n must be 1.

Messages

  • Accepted: model, max_tokens, system, messages with text blocks, stream, temperature, top_p, stop_sequences.
  • With the Anthropic SDK, set the base URL to https://api.commentllm.com: the SDK adds /v1/messages.

Tool use and structured output are not currently available for these models on either endpoint.

Every response carries

  • x-request-id: the ID that Logs and Usage show for this request.
  • x-ratelimit-limit-requests and x-ratelimit-remaining-requests for the current minute.

Streaming#

Set stream: true. Chat Completions sends chat.completion.chunk events, then a chunk with usage, then data: [DONE]. Messages sends the Anthropic event sequence, from message_start to message_stop.

curl
curl -N https://api.commentllm.com/v1/chat/completions \
-H "Authorization: Bearer $COMMENTLLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "deepseek-v4.1-flash-1017-abliterated", "stream": true, "max_tokens": 1024,
"messages": [{"role": "user", "content": "Draft a test plan for my scope."}]}'
Response
data: {"object":"chat.completion.chunk","choices":[{"delta":{"content":"Here is"}}],...}
data: {"object":"chat.completion.chunk","choices":[{"delta":{},"finish_reason":"stop"}],...}
data: {"object":"chat.completion.chunk","choices":[],"usage":{"total_tokens":412,...}}
data: [DONE]

When a policy checks responses, the whole answer is checked before any text is sent, so the stream arrives in one piece. If a stream fails partway, an error event is sent before it closes. The gateway confirms usage before it sends the final success event. If it cannot confirm a charge, use the x-request-id response header to look up the request in Usage before retrying.

Policies#

Policies run in the gateway: on every request before the model sees it, and on every response when they check responses. You write them in the console under Policies.

TypeMatches
PII and secretsEmails, phone numbers, US SSNs, card numbers that pass a Luhn check, AWS access keys, private keys and JWTs.
KeywordsAny of a list of terms, ignoring case. Client names, hostnames, code names.
PatternA regular expression of up to 300 characters.
ScopeHostnames and IPv4 addresses that no active engagement lists. See Scope.
Model-judgedA yes or no question about the content, answered by a model. If the judge cannot answer, enforcing policies block and monitoring policies log the error and continue.

How a policy goes live

  • Draft. Edit freely. Nothing runs.
  • Monitoring. Matches are logged as Flagged. Nothing changes.
  • Enforcing. Redact replaces each match, for example with [REDACTED:email], and continues. Block rejects the request with policy_violation. A blocked request is not billed.

Publishing creates a numbered version. The gateway always runs the live version, so editing a draft changes nothing until you publish it.

Blocked requests

403 policy_violation
{
"error": {
"message": "Request blocked by policy \"Engagement scope\". payroll.example.org is not in an active engagement.",
"type": "invalid_request_error",
"code": "policy_violation",
"policy": "Engagement scope",
"reason": "payroll.example.org is not in an active engagement.",
"stage": "request"
}
}

Opt-in policies

A policy that applies to Opt-in per request runs only when the request names it in policy_ids.

curl
curl https://api.commentllm.com/v1/chat/completions \
-H "Authorization: Bearer $COMMENTLLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "deepseek-v4.1-flash-1017-abliterated",
"max_tokens": 1024, "policy_ids": ["7d1f0c2e-…"],
"messages": [{"role": "user", "content": "…"}]}'

Scope#

An engagement records written authorization: the client, the authorization reference, the dates and the authorized targets. When enabled and enforcing, the scope policy checks hostnames and IPv4 addresses in each request and blocks detected targets that no active engagement lists. It cannot identify every possible reference to a target.

TargetCovers
acme.exampleacme.example and every subdomain of it.
*.acme.exampleSubdomains of acme.example, and acme.example itself.
203.0.113.7That address.
10.20.0.0/16Every IPv4 address in the range.
  • An engagement is active when its status is Active and today falls within its dates. Drafts and closed engagements allow nothing.
  • An engagement tied to a project applies only to keys in that project. One without a project applies to the whole organization.
  • File names such as exploit.py are not treated as hosts.

Errors#

Errors use the format of the endpoint you called. Chat Completions returns { "error": { "message", "type", "code" } }.

StatusCodeWhat to do
400invalid_requestFix the field named in the message.
400context_length_exceededShorten the conversation.
401invalid_api_keyCheck the key. It may be revoked or expired.
402insufficient_creditsCheck Billing for available credit. Lower your output limit or retry once other requests finish.
403policy_violationA policy blocked it. See Logs for which one.
403organization_suspendedThe organization is suspended. Contact us.
403aup_not_acceptedAn owner or admin accepts the Acceptable Use Policy in the console.
403ip_not_allowedCall from an address on your allowlist.
404model_not_foundList models at /v1/models.
413request_too_largeKeep request bodies under 8 MB.
429rate_limit_exceededWait for the Retry-After time.
502upstream_errorRetry shortly. A request that fails before the answer starts is not billed.
503usage_unavailableThe gateway could not confirm the usage record. Look up the request ID in Usage before retrying.

Rate limits#

Limits count requests per minute, for each key. Your organization's tier sets the ceiling; a key can have a lower limit of its own.

TierRequests per minuteHow you reach it
160Every new organization.
2300$50 of credit purchases.
31,000$200 of credit purchases.
45,000Talk to us.

Over the limit, requests get 429 rate_limit_exceeded with a retry-after header in seconds. Every response says how many requests remain this minute.

SIEM export#

Admins add destinations under Logs, Exports. After each request a policy checked, its decisions go to every destination. Only metadata is sent: policy names, outcomes and counts.

Event
{
"type": "policy.decisions",
"request_id": "req_9f8e7d6c5b4a4c3d8e2f1a0b9c8d7e6f",
"org_id": "9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f",
"project_id": "2c7d9e1f-…",
"occurred_at": "2026-11-21T14:02:11.000Z",
"decisions": [
{
"policy_id": "…",
"policy_name": "Engagement scope",
"policy_version": 4,
"stage": "request",
"outcome": "blocked",
"detail": { "out_of_scope_count": 1 }
}
]
}
DestinationHow it is sent
Splunk HECThe event inside { "sourcetype": "commentllm:policy", "event": … }, with Authorization: Splunk <token>.
DatadogA log entry with ddsource: commentllm and service: policy-gateway, with the dd-api-key header.
ElasticThe event as the document, with Authorization: ApiKey <key>.
WebhookThe event as JSON, signed with x-commentllm-timestamp and x-commentllm-signature.

Endpoints must use https. A delivery times out after 8 seconds and does not follow redirects. Logs, Exports shows the last delivery and when a destination started failing.

Verify a webhook

The signature is an HMAC-SHA256 of the timestamp, a dot and the raw body, keyed with your signing secret.

Node.js
import { createHmac, timingSafeEqual } from "node:crypto";
// body is the raw request body, exactly as received.
export function verify(headers, body, secret) {
const ts = headers["x-commentllm-timestamp"];
const got = Buffer.from(headers["x-commentllm-signature"] ?? "");
const want = Buffer.from("sha256=" + createHmac("sha256", secret).update(`${ts}.${body}`).digest("hex"));
const fresh = Math.abs(Date.now() / 1000 - Number(ts)) < 300;
return fresh && got.length === want.length && timingSafeEqual(got, want);
}

Data handling#

Prompts and responses live in memory for one request, then they are gone.

StoredNever stored
Request ID, model and endpointPrompts
Token counts and costResponses
Latency and statusText a policy matched
Policy names, outcomes and countsAnything for training
  • Decisions record counts, such as 2 emails, 1 phone, never the matched text.
  • The playground is billed and logged like the API. Nothing you type there is saved.
  • API keys are stored as hashes. A key is shown once, when you create it.

More in the Trust page and the Privacy Policy.

Ready to send your first request?