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.
Or keep the SDK you use today and change its base URL.
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.
| Model | API model ID | Context window | Max output | Inputs |
|---|---|---|---|---|
| DeepSeek V4.1 Flash 1017 Abliterated | deepseek-v4.1-flash-1017-abliterated | 1,048,576 tokens | 32,768 tokens | Text |
| Qwen 3.8 27B Abliterated | qwen3.8-27b-abliterated | 262,144 tokens | 65,536 tokens | Text |
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.
API reference#
| Method | Path | Use |
|---|---|---|
| GET | /v1/models | List models and prices. |
| POST | /v1/chat/completions | OpenAI Chat Completions. |
| POST | /v1/messages | Anthropic 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). nmust 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-requestsandx-ratelimit-remaining-requestsfor 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.
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.
| Type | Matches |
|---|---|
| PII and secrets | Emails, phone numbers, US SSNs, card numbers that pass a Luhn check, AWS access keys, private keys and JWTs. |
| Keywords | Any of a list of terms, ignoring case. Client names, hostnames, code names. |
| Pattern | A regular expression of up to 300 characters. |
| Scope | Hostnames and IPv4 addresses that no active engagement lists. See Scope. |
| Model-judged | A 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 withpolicy_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
Opt-in policies
A policy that applies to Opt-in per request runs only when the request names it in policy_ids.
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.
| Target | Covers |
|---|---|
| acme.example | acme.example and every subdomain of it. |
| *.acme.example | Subdomains of acme.example, and acme.example itself. |
| 203.0.113.7 | That address. |
| 10.20.0.0/16 | Every 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.pyare not treated as hosts.
Errors#
Errors use the format of the endpoint you called. Chat Completions returns { "error": { "message", "type", "code" } }.
| Status | Code | What to do |
|---|---|---|
| 400 | invalid_request | Fix the field named in the message. |
| 400 | context_length_exceeded | Shorten the conversation. |
| 401 | invalid_api_key | Check the key. It may be revoked or expired. |
| 402 | insufficient_credits | Check Billing for available credit. Lower your output limit or retry once other requests finish. |
| 403 | policy_violation | A policy blocked it. See Logs for which one. |
| 403 | organization_suspended | The organization is suspended. Contact us. |
| 403 | aup_not_accepted | An owner or admin accepts the Acceptable Use Policy in the console. |
| 403 | ip_not_allowed | Call from an address on your allowlist. |
| 404 | model_not_found | List models at /v1/models. |
| 413 | request_too_large | Keep request bodies under 8 MB. |
| 429 | rate_limit_exceeded | Wait for the Retry-After time. |
| 502 | upstream_error | Retry shortly. A request that fails before the answer starts is not billed. |
| 503 | usage_unavailable | The 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.
| Tier | Requests per minute | How you reach it |
|---|---|---|
| 1 | 60 | Every new organization. |
| 2 | 300 | $50 of credit purchases. |
| 3 | 1,000 | $200 of credit purchases. |
| 4 | 5,000 | Talk 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.
| Destination | How it is sent |
|---|---|
| Splunk HEC | The event inside { "sourcetype": "commentllm:policy", "event": … }, with Authorization: Splunk <token>. |
| Datadog | A log entry with ddsource: commentllm and service: policy-gateway, with the dd-api-key header. |
| Elastic | The event as the document, with Authorization: ApiKey <key>. |
| Webhook | The 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.
Data handling#
Prompts and responses live in memory for one request, then they are gone.
| Stored | Never stored |
|---|---|
| Request ID, model and endpoint | Prompts |
| Token counts and cost | Responses |
| Latency and status | Text a policy matched |
| Policy names, outcomes and counts | Anything 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?