Anthropic-compatible API
BetaUse Anthropic SDKs and Anthropic-native tools with Nebula through the Messages API. In beta.
On this page
The Messages API accepts Anthropic’s request format and returns Anthropic’s responses and stream events. It runs on the same gateway as chat completions, so scopes, rate limits, the credit check, idempotency and metering behave identically.
/api/v1/llm/v1/messages Betastream and Idempotency-Key.Scope: llm:access or llm:chat
/api/v1/llm/v1/messages/count_tokens BetaScope: llm:access or llm:chat
Configure a client
Anthropic SDKs take the base URL without the trailing /v1; they add /v1/messages themselves.
| Setting | Value |
|---|---|
| Base URL | https://api.breachline.io/api/v1/llm |
| API key | Your bl_live_ key, sent as x-api-key (or Authorization: Bearer) |
| Model | nebula-4.5 |
Python
import os
import anthropic
client = anthropic.Anthropic(
api_key=os.environ["BREACHLINE_API_KEY"],
base_url="https://api.breachline.io/api/v1/llm",
)
message = client.messages.create(
model="nebula-4.5",
max_tokens=1024,
system="You are a concise security assistant.",
messages=[{"role": "user", "content": "Summarise the risk of a missing Content-Security-Policy header."}],
)
print(message.content[0].text)
TypeScript
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({
apiKey: process.env.BREACHLINE_API_KEY,
baseURL: 'https://api.breachline.io/api/v1/llm',
});
const message = await client.messages.create({
model: 'nebula-4.5',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Summarise the risk of a missing Content-Security-Policy header.' }],
});
cURL
curl https://api.breachline.io/api/v1/llm/v1/messages \
-H "x-api-key: $BREACHLINE_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "nebula-4.5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Summarise the risk of a missing Content-Security-Policy header."}]
}'
Environment
export ANTHROPIC_BASE_URL="https://api.breachline.io/api/v1/llm"
export ANTHROPIC_API_KEY="$BREACHLINE_API_KEY"
Supported features
| Feature | Support |
|---|---|
| Text, images (base64 or URL) | Supported. Images must be JPEG, PNG, GIF or WebP. |
| Documents | Inline only: base64 PDF, plain text or content blocks. |
Custom tools, tool_use, tool_result |
Supported. tool_choice accepts auto, any, tool and none, and honours disable_parallel_tool_use. |
thinking |
enabled, adaptive or disabled, with optional budget_tokens and display. |
output_config |
effort (low, medium, high, xhigh, max) and format (json_schema). |
system, stop_sequences (up to 16), metadata |
Supported. |
temperature, top_p |
0 to 1. |
stream |
Anthropic stream events, including ping. |
Refused rather than ignored
Features that would change behaviour without warning are rejected with 400 instead of being silently dropped:
- Server tools, such as web search and code execution.
mcp_serversandcontainer.- Document sources BreachLine would have to fetch (
urlorfile).
These are accepted and have no effect: top_k, cache_control, service_tier, context_management, and the anthropic-version header.
Usage and errors
- Usage follows Anthropic’s convention:
input_tokensexcludes cache reads and writes, which are reported ascache_read_input_tokensandcache_creation_input_tokens. - Stop reasons are
end_turn,max_tokens,stop_sequence,tool_useandrefusal. - Errors use Anthropic’s envelope with the same HTTP status. A prompt that is too long starts its message with
prompt is too long, so clients that compact their context on overflow can recover. See Errors.
Counting tokens
count_tokens returns an estimate of about 4 characters per token over the translated request. Requests are routed across engines with different tokenizers, so no single exact count exists. Bodies over 4 MiB get 413.