Chat API
Chat Completions, Messages (Anthropic), and Responses. OpenAI and Anthropic drop-in, streaming, function calling.
Chat Completions, Messages (Anthropic), and Responses. OpenAI and Anthropic drop-in, streaming, function calling.
Send chat messages and receive an AI-generated response.
/api/v1/llm/chat/completionsSDK compatibility
| Parameter | Type | Description |
|---|---|---|
modelrequired | string | Model ID, e.g. gpt-4o or claude-sonnet-4-20250514. |
messagesrequired | array | Array of messages with role and content. |
stream | boolean | If true, the response is streamed via SSE. |
temperature | number | Response creativity (0–2). Lower values = more focused. |
max_tokens | integer | Maximum number of tokens in the response. |
top_p | number | Nucleus sampling — alternative to temperature. |
response_format | object | Forces a specific output format (e.g. JSON). |
tools | array | List of tools/functions the model can call. |
tool_choice | string | Controls whether and which tools are called. |
frequency_penalty | number | Penalizes frequently used tokens (-2 to 2). |
presence_penalty | number | Penalizes already used tokens (-2 to 2). |
stop | string | array | Sequences at which generation stops. |
cache_control | object | Claude models only: a prompt caching breakpoint. At the top level for automatic caching, or on a tool, a message or a content part. |
prompt_cache_key | string | Optional key that steers related requests to the same cache (OpenAI parameter). For routing anymize only uses a hash of it; the key itself goes in the body only to OpenAI and Mistral, which know the parameter. Leave it out and anymize derives one per conversation. |
Each message has a role (system, user, assistant) and content.
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is the capital of France?"
},
{
"role": "assistant",
"content": "The capital of France is Paris."
},
{
"role": "user",
"content": "And Germany?"
}
]Minimal request with a single user message.
1curl -X POST https://app.anymize.ai/api/v1/llm/chat/completions \2 -H "Authorization: Bearer YOUR_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "model" : "fountain-1 .0 " ,6 "messages" : [7 {"role" : "system" , "content" : "You are a helpful assistant." },8 {"role" : "user" , "content" : "Explain quantum computing in one sentence." }9 ],10 "temperature" : 0 .7 ,11 "max_tokens" : 256 12 }'The response contains the generated message, model info, and token usage.
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1700000000,
"model": "fountain-1.0",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum computing uses quantum-mechanical phenomena like superposition and entanglement to process information in ways that classical computers cannot."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 28,
"completion_tokens": 24,
"total_tokens": 52
}
}Every response includes prompt_tokens, completion_tokens, and total_tokens.
If your organization enforces prompt anonymization, anymize replaces personal data in every message before any model or the automatic model selection (model: auto) sees it: system and developer messages, user and assistant messages, every text part, tool results and tool arguments. The same value gets the same placeholder across the whole request.
Set the anonymization language with the language field (de, en, fr, da, es, no). Without it, Accept-Language applies, otherwise German. The field is never sent to the model provider.
The response comes back with the placeholders. anymize does not put the originals back in.
What gets rejected
The model reads repeated prefixes (system prompt, tools, earlier conversation) from the cache instead of processing them again. For Claude models anymize turns this on automatically as soon as a request carries tools or an earlier assistant reply. One-shot requests stay uncached, because a cache write never pays off there.
Want control? Set cache_control the way OpenRouter does: at the top level for automatic caching, on a tool, on a message (applies to its end) or on a content part. Your breakpoints win, and anymize adds none of its own. Four per request at most, ttl is 5m (default) or 1h. For every other model anymize removes the field.
{
"model": "anthropic/claude-sonnet-4.6",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a contract review assistant. <long, stable instructions>",
"cache_control": {
"type": "ephemeral"
}
}
]
},
{
"role": "user",
"content": "Check clause 7 for liability caps."
}
]
}The usage object shows the cache counts under prompt_tokens_details: cached_tokens were read from the cache, cache_write_tokens were newly written to it. For Claude, cache_write_1h_tokens also gives the part of cache_write_tokens written with ttl 1h; if there is none, the field is missing. prompt_tokens includes cached_tokens and cache_write_tokens.
{
"usage": {
"prompt_tokens": 12450,
"completion_tokens": 210,
"total_tokens": 12660,
"prompt_tokens_details": {
"cached_tokens": 12000,
"cache_write_tokens": 400
}
}
}Billing
OpenAI, Gemini, Mistral, Grok and Waterfall 2 models cache without breakpoints. Where the provider supports a key, anymize sends one per conversation so related requests hit the same cache. Set prompt_cache_key to choose it yourself.
When sending pre-anonymized text to the standard chat endpoint, the model must preserve [[Type-HASH]] placeholders exactly. Add the following system prompt to your messages.
Without prompt
Dear [name redacted], regarding your request...
With prompt
Dear Mr. [[Person-ABC123]], regarding your request...
Without explicit instructions, the model replaces placeholders with generic descriptions like '[redacted]'. This breaks the mapping for de-anonymization.
When processing pre-anonymized text, add this part to your system prompt:
1const response = await client.chat.completions.create({2 model: "fountain-1 .0 " ,3 messages: [4 {5 role: "system" ,6 content: `## CRITICAL RULE: ANONYMIZATION PLACEHOLDERS78The user's messages contain anonymized placeholders shaped [[<Type>-<HASH>]],9where <Type> is the PII category (person, email, iban, telephone_number, ...)10and <HASH> is a short random code.1112FORBIDDEN:13- Writing "[Name anonymisiert]" or "[anonymized]" 14- Describing WHAT the placeholder is instead of USING it15- Writing a double-bracket token that was NOT in the user's message — the hash16 is a database key, so an invented one resolves to nothing.1718REQUIRED:19- Copy each placeholder character-for-character from the user's message20- Use it inline like the real value: "Herr <placeholder> hat..." 21- Need a value the user never gave you? Use SINGLE brackets ([Name]).2223WHY: After your response, placeholders get replaced with real values.`,24 },25 {26 role: "user" ,27 content: "Schreibe eine E-Mail an [[Person-ABC123]] bezuglich dem Vertrag." ,28 },29 ],30})3132// Model responds: "Sehr geehrter Herr [[Person-ABC123]], ..." 33// After de-anonymization: "Sehr geehrter Herr Max Mustermann, ..." Or use the anonymous endpoint
Web research with sources using your personal anymize API key.
Basic costs 520 credits (EUR 0.0104), Advanced 1,040 credits (EUR 0.0208) per successful search, including searches with no results. Chat tokens are billed separately.
In Chat Completions, web_search_options runs exactly one search before the model answers. query is optional; otherwise the last user message is used, up to 400 characters. search_context_size low/medium/high selects 3/5/8 results. citations, search_results and search_usage contain sources and search charges. Streaming sends them in an initial SSE chunk with choices: [].
The query is sent to Tavily. disable_web_search and mandatory prompt anonymization block this search path with HTTP 403. Model-provider ZDR assurances do not describe search-provider retention.
Repeated POSTs are new billable searches. Disable automatic SDK retries. An executed search remains billable if the subsequent model response or a later policy check fails. Search results are third-party evidence, not proof of identity.
1{2 "model" : "waterfall-2 .0 " ,3 "messages" : [4 {5 "role" : "user" ,6 "content" : "Research this person's role and company; distinguish namesakes." 7 }8 ],9 "web_search_options" : {10 "query" : "Synthetic Person Example GmbH" ,11 "search_depth" : "basic" ,12 "max_results" : 5 13 }14}/api/v1/searchBody
| Parameter | Type | Description |
|---|---|---|
queryrequired | string | Query of 1 to 400 characters. Include both name and company for contact research. |
search_depth | "basic" | "advanced" | basic: one search unit; advanced: two search units. |
max_results | integer | 1 to 10 results, default 5. |
include_domains / exclude_domains | string[] | Up to 20 hostnames per list, without protocol or path. |
{
"id": "search-example",
"object": "search.result",
"model": "anymize-search",
"query": "Synthetic Person Example GmbH",
"results": [
{
"title": "Example",
"url": "https://example.com",
"content": "Public source extract",
"score": 0.9
}
],
"citations": [
"https://example.com"
],
"usage": {
"search_units": 1,
"credits_used": 520
}
}1curl https://app.anymize.ai/api/v1/search \2 -H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' \3 -d '{"query":"Synthetic Person Example GmbH","search_depth":"basic","max_results":5 }' /api/v1/llm/searchBody
| Parameter | Type | Description |
|---|---|---|
queryrequired | string | Query of 1 to 400 characters. Include both name and company for contact research. |
search_depth | "basic" | "advanced" | basic: one search unit; advanced: two search units. |
max_results | integer | 1 to 10 results, default 5. |
include_domains / exclude_domains | string[] | Up to 20 hostnames per list, without protocol or path. |
waterfall-2.0 handles image_url natively through Chat Completions. Use a provider-accessible HTTPS URL or a suitable image data URL. The anonymizing chat route does not support this image path. Text-only recovery lanes are skipped for images; image input is billed as model input. Mandatory prompt anonymization rejects image input with HTTP 403 because text redaction does not redact pixels.
JSON schemas are forwarded unchanged, including strict, nested anyOf and type: null. type: ["string", "null"] is preserved as well. Smoke-test your concrete schema and validate outputs, especially on truncation or refusal.
The synchronous audio route returns the finished text without polling. There is no guaranteed 40-second latency for five minutes of audio. language: de avoids the additional language probe; start with a 120-second client timeout and measure your recordings.
1{2 "model" : "waterfall-2 .0 " ,3 "messages" : [4 {5 "role" : "user" ,6 "content" : [7 {8 "type" : "text" ,9 "text" : "Extract the person's name and company from this screenshot." 10 },11 {12 "type" : "image_url" ,13 "image_url" : {14 "url" : "https://example.com/screenshot.png" ,15 "detail" : "auto" 16 }17 }18 ]19 }20 ],21 "response_format" : {22 "type" : "json_schema" ,23 "json_schema" : {24 "name" : "contact" ,25 "strict" : true,26 "schema" : {27 "type" : "object" ,28 "properties" : {29 "name" : {30 "anyOf" : [31 {32 "type" : "string" 33 },34 {35 "type" : "null" 36 }37 ]38 },39 "company" : {40 "type" : [41 "string" ,42 "null" 43 ]44 }45 },46 "required" : [47 "name" ,48 "company" 49 ],50 "additionalProperties" : false51 }52 }53 }54}POST /api/v1/messages is the Anthropic path. Set the base URL to https://app.anymize.ai/api so the client calls /v1/messages. Same anonymization, same credits, same models as Chat Completions.
/api/v1/messagesSDK compatibility
Three paths, one handler. Every common base-URL convention lands on the same pipeline.
https://app.anymize.ai/api/v1/messageshttps://app.anymize.ai/api/v1/llm/messageshttps://app.anymize.ai/api/v1/llm/v1/messagesAuthorization: Bearer ANYM_... or x-api-key: ANYM_... Claude Code must use ANTHROPIC_AUTH_TOKEN (Bearer). ANTHROPIC_API_KEY sends x-api-key and some custom-gateway paths reject that. Unset ANTHROPIC_API_KEY when you switch.
1-H "Authorization: Bearer YOUR_API_KEY" | Parameter | Type | Description |
|---|---|---|
modelrequired | string | Model id, e.g. anthropic/claude-sonnet-4.6 or openai/gpt-5.4. Same ids as Chat Completions. |
messagesrequired | array | Array of user and assistant messages. Content as a string or blocks (text, image, tool_use, tool_result). |
max_tokensrequired | integer | Required by Anthropic. If missing, anymize sets 4096. |
system | string | array | String or array of text blocks. Becomes the OpenAI system message. |
stream | boolean | true returns Anthropic SSE. Usage arrives on message_delta. |
temperature | number | Creativity (0-2). Forwarded 1:1 to Completions. |
top_p | number | Nucleus sampling. Forwarded 1:1 to Completions. |
tools | array | Anthropic tools (name + input_schema) and client tools such as bash_20250124. Mapped to OpenAI functions. |
tool_choice | object | auto, any (required), none, or a specific tool by name. |
stop_sequences | array | stop_sequences become OpenAI stop. |
thinking | object | thinking.budget_tokens maps to reasoning.effort (low / medium / high). |
cache_control | object | At the top level for automatic caching. anymize keeps cache_control on system blocks, tools and content blocks for Claude models; a breakpoint then applies to the end of its message or of the system prompt. |
1curl https://app.anymize.ai/api/v1/messages \2 -H "x-api-key: YOUR_API_KEY" \3 -H "anthropic-version: 2023 -06 -01 " \4 -H "content-type: application/json" \5 -d '{6 "model" : "anthropic/claude-haiku-4 .5 " ,7 "max_tokens" : 256 ,8 "messages" : [{ "role" : "user" , "content" : "Hello" }]9 }'Anthropic message: id, role assistant, content blocks, stop_reason, usage.input_tokens / output_tokens.
{
"id": "msg_01abc",
"type": "message",
"role": "assistant",
"model": "anthropic/claude-haiku-4.5",
"content": [
{
"type": "text",
"text": "Hello"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 12,
"output_tokens": 4,
"cache_read_input_tokens": 0,
"cache_creation_input_tokens": 0
}
}The stream follows Anthropic: message_start, content_block_start/delta/stop, message_delta (usage + stop reason), message_stop. Tool calls arrive as tool_use blocks with partial_json.
Claude Code and the Anthropic SDK set cache_control themselves. anymize passes these breakpoints on to Claude instead of dropping them. Without breakpoints of your own, anymize turns on automatic caching for requests with tools or history. A breakpoint inside a message moves to its end, four per request at most.
{
"model": "anthropic/claude-sonnet-4.6",
"max_tokens": 1024,
"system": [
{
"type": "text",
"text": "You are a contract review assistant. <long, stable instructions>",
"cache_control": {
"type": "ephemeral"
}
}
],
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Check clause 7 for liability caps.",
"cache_control": {
"type": "ephemeral"
}
}
]
}
]
}usage follows Anthropic: input_tokens are the tokens without cache, cache_read_input_tokens were read from the cache, cache_creation_input_tokens were newly written. When streaming, the final counts arrive in message_delta.
{
"usage": {
"input_tokens": 50,
"output_tokens": 210,
"cache_read_input_tokens": 12000,
"cache_creation_input_tokens": 400
}
}Claude's thinking blocks come back with their signature. Send them back unchanged in the next turn and the model keeps reasoning with the same context.
Billing
POST .../count_tokens estimates input tokens locally, with no credit debit. Claude Code and the SDK call this before the real request. Billing still runs through Completions.
/api/v1/messages/count_tokensGET /api/v1/models with an anthropic-version header (and GET /api/v1/llm/v1/models) returns the Anthropic list with data and has_more. Same ids as GET /api/v1/llm/models. The in-app picker without that header stays unchanged.
/api/v1/modelsGET /api/v1/llm/v1/models
Claude Code
Set stream: true in the request to receive responses in real time.
/api/v1/llm/chat/completionsResponses arrive as Server-Sent Events — one chunk per line with a data: prefix.
data: {"id": "chatcmpl-abc123","object": "chat.completion.chunk","created": 1700000000,"model": "fountain-1.0","choices":[{"index": 0,"delta":{"content": "Hello"},"finish_reason": null}]}
data: {"id": "chatcmpl-abc123","object": "chat.completion.chunk","created": 1700000000,"model": "fountain-1.0","choices":[{"index": 0,"delta":{"content": " world"},"finish_reason": null}]}
data: {"id": "chatcmpl-abc123","object": "chat.completion.chunk","created": 1700000000,"model": "fountain-1.0","choices":[{"index": 0,"delta":{},"finish_reason": "stop"}]}
data: [DONE]Each chunk contains a delta object with the new text fragment.
{
"id": "chatcmpl-abc123",
"object": "chat.completion.chunk",
"created": 1700000000,
"model": "fountain-1.0",
"choices": [
{
"index": 0,
"delta": {
"content": "Hello"
},
"finish_reason": null
}
]
}Read the stream line by line and parse each data: line as JSON.
1curl -X POST https://app.anymize.ai/api/v1/llm/chat/completions \2 -H "Authorization: Bearer YOUR_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "model" : "fountain-1 .0 " ,6 "messages" : [7 {"role" : "user" , "content" : "Write a short poem about the sea." }8 ],9 "stream" : true10 }'The first chunk typically contains the role and an empty content delta.
{
"id": "chatcmpl-abc123",
"object": "chat.completion.chunk",
"created": 1700000000,
"model": "fountain-1.0",
"choices": [
{
"index": 0,
"delta": {
"role": "assistant",
"content": ""
},
"finish_reason": null
}
]
}Token info during streaming
Force structured JSON outputs from the model — ideal for data extraction and APIs.
Set response_format to json_object to enforce valid JSON output.
/api/v1/llm/chat/completions1curl -X POST https://app.anymize.ai/api/v1/llm/chat/completions \2 -H "Authorization: Bearer YOUR_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "model" : "fountain-1 .0 " ,6 "messages" : [7 {"role" : "system" , "content" : "You extract contact info. Respond in JSON with keys: name, email, phone." },8 {"role" : "user" , "content" : "My name is Anna Schmidt, email anna@example.com, phone +49 170 1234567 ." }9 ],10 "response_format" : {"type" : "json_object" }11 }'{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "fountain-1.0",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "{\"name\": \"Anna Schmidt\", \"email\": \"anna@example.com\", \"phone\": \"+49 170 1234567\"}"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 42,
"completion_tokens": 28,
"total_tokens": 70
}
}Define the output schema and choose a model with schema support. Known unsupported transports return HTTP 400 with unsupported_response_format before the model call. A schema is never silently downgraded to a best-effort JSON request.
1curl -X POST https://app.anymize.ai/api/v1/llm/chat/completions \2 -H "Authorization: Bearer YOUR_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "model" : "fountain-1 .0 " ,6 "messages" : [7 {"role" : "user" , "content" : "List three European capitals with their countries and population." }8 ],9 "response_format" : {10 "type" : "json_schema" ,11 "json_schema" : {12 "name" : "capitals" ,13 "schema" : {14 "type" : "object" ,15 "properties" : {16 "capitals" : {17 "type" : "array" ,18 "items" : {19 "type" : "object" ,20 "properties" : {21 "city" : {"type" : "string" },22 "country" : {"type" : "string" },23 "population" : {"type" : "number" }24 },25 "required" : ["city" , "country" , "population" ]26 }27 }28 },29 "required" : ["capitals" ]30 }31 }32 }33 }'Prompt tip
Function Calling lets the model call your defined tools. Instead of just generating text, the model recognizes when an external tool would be helpful and returns the parameters. You execute the function locally and send the result back.
The flow in four steps:
Web search (Brave, Google, etc.)
Database queries and CRM systems
Email and messaging
External APIs (weather, calendar, maps, etc.)
Tools are defined as JSON Schema. The model uses the descriptions to decide when to call which tool.
{
"type": "function",
"function": {
"name": "web_search",
"description": "Search the web for current information",
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "The search query"
}
},
"required": [
"query"
]
}
}
}A complete example: The model recognizes that current information is needed, calls the Brave Search API, and summarizes the results.
1import OpenAI from "openai" 23const client = new OpenAI({4 apiKey: "YOUR_API_KEY" ,5 baseURL: "https://app.anymize.ai/api/v1/llm" ,6})78const BRAVE_API_KEY = process.env.BRAVE_API_KEY910// Step 1 : Define the tool 11const tools = [12 {13 type: "function " as const ,14 function : {15 name: "web_search" ,16 description: "Search the web for current information. Use this when the user asks about recent events, news, or anything that requires up-to-date data." ,17 parameters: {18 type: "object" ,19 properties: {20 query: { type: "string" , description: "Search query" },21 },22 required: ["query" ],23 },24 },25 },26]2728// Step 2 : Send message with tools 29const response = await client.chat.completions.create({30 model: "fountain-1 .0 " ,31 messages: [32 { role: "user" , content: "What are the latest AI news today?" },33 ],34 tools,35 tool_choice: "auto" ,36})3738const message = response.choices[0 ].message3940// Step 3 : Check if the model wants to call a tool 41if (message.tool_calls && message.tool_calls.length > 0 ) {42 const toolCall = message.tool_calls[0 ]43 const args = JSON.parse(toolCall.function .arguments)4445 // Step 4 : Execute the Brave Search API 46 const searchResponse = await fetch(47 `https://api.search.brave.com/res/v1/web/search?q=${encodeURIComponent(args.query)}&count=5 `,48 { headers: { "X-Subscription-Token" : BRAVE_API_KEY } },49 )50 const searchData = await searchResponse.json()5152 // Format results for the model 53 const results = searchData.web?.results54 ?.map((r: any) => `${r.title}: ${r.description}`)55 .join("\n" ) || "No results found" 5657 // Step 5 : Send the search results back to the model 58 const finalResponse = await client.chat.completions.create({59 model: "fountain-1 .0 " ,60 messages: [61 { role: "user" , content: "What are the latest AI news today?" },62 message,63 {64 role: "tool" ,65 tool_call_id: toolCall.id,66 content: results,67 },68 ],69 })7071 console.log(finalResponse.choices[0 ].message.content)72}When the model wants to call a tool, the response contains tool_calls instead of content. The finish_reason is 'tool_calls'.
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "fountain-1.0",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": null,
"tool_calls": [
{
"id": "call_abc123",
"type": "function",
"function": {
"name": "web_search",
"arguments": "{\"query\": \"latest AI news today\"}"
}
}
]
},
"finish_reason": "tool_calls"
}
]
}Check finish_reason
You can define multiple tools. The model automatically picks the right one based on the message.
1const tools = [2 {3 type: "function " ,4 function : {5 name: "web_search" ,6 description: "Search the web for current information" ,7 parameters: {8 type: "object" ,9 properties: {10 query: { type: "string" },11 },12 required: ["query" ],13 },14 },15 },16 {17 type: "function " ,18 function : {19 name: "get_weather" ,20 description: "Get current weather for a location" ,21 parameters: {22 type: "object" ,23 properties: {24 location: { type: "string" },25 },26 required: ["location" ],27 },28 },29 },30 {31 type: "function " ,32 function : {33 name: "send_email" ,34 description: "Send an email to a recipient" ,35 parameters: {36 type: "object" ,37 properties: {38 to: { type: "string" , description: "Email address" },39 subject: { type: "string" },40 body: { type: "string" },41 },42 required: ["to" , "subject" , "body" ],43 },44 },45 },46]4748// The model picks the right tool based on the user's message 49const response = await client.chat.completions.create({50 model: "fountain-1 .0 " ,51 messages: [52 { role: "user" , content: "Search for the latest Next.js release" },53 ],54 tools,55 tool_choice: "auto" ,56})Use tool_choice to control if and how the model uses tools.
| Parameter | Type | Description |
|---|---|---|
"auto" | string | Model decides on its own (default) |
"none" | string | No tool will be called |
"required" | string | Model must call a tool |
{"type": "function", ...} | object | Force a specific function call |
Function Calling is the foundation for the Model Context Protocol (MCP) and similar tool platforms. You can integrate MCP servers as function calling tools by passing the MCP server's tool definitions as the tools parameter.
MCP compatible
Reasoning models show their thought process — ideal for complex logic and multi-step problems.
Different models offer reasoning in different ways.
waterfall-2.0anymize Waterfall 2 is our fast model for code and tool use. Without the `reasoning` parameter it answers without reasoning.Control reasoning effort via the reasoning_effort parameter.
/api/v1/llm/chat/completions| Parameter | Type | Description |
|---|---|---|
reasoning.effortrequired | string | Determines how much the model thinks before responding. |
"low"Quick response with minimal thinking."medium"Balanced mode — good for most tasks."high"Maximum thinking for complex problems.Request to a reasoning model with medium effort.
1curl -X POST https://app.anymize.ai/api/v1/llm/chat/completions \2 -H "Authorization: Bearer YOUR_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "model" : "waterfall-2 .0 " ,6 "messages" : [7 {"role" : "user" , "content" : "A farmer has 17 sheep. All but 9 run away. How many sheep does he have left?" }8 ],9 "reasoning" : {10 "effort" : "high" 11 }12 }'The response contains the visible thought process and the final answer.
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "waterfall-2.0",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The farmer has 9 sheep left. The phrase \"all but 9\" means every sheep except 9 ran away."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 32,
"completion_tokens": 45,
"total_tokens": 77,
"reasoning_tokens": 128
}
}Token usage note
Recommendation
Simplified API format for quick integrations — inspired by the Responses format.
/api/v1/llm/responsesCompatibility
| Parameter | Type | Description |
|---|---|---|
modelrequired | string | Model ID, same as Chat Completions. |
inputrequired | string | array | Input as a string or array of messages. |
instructions | string | System instructions as a string (replaces the system role). |
temperature | number | Response creativity (0–2). |
max_output_tokens | integer | Maximum number of tokens in the response. |
top_p | number | Nucleus sampling parameter. |
You can send input as a simple string or as a message array.
{
"model": "fountain-1.0",
"input": "What is the capital of France?"
}{
"model": "fountain-1.0",
"input": [
{
"role": "user",
"content": "What is the capital of France?"
}
],
"instructions": "You are a helpful geography assistant."
}1curl -X POST https://app.anymize.ai/api/v1/llm/responses \2 -H "Authorization: Bearer YOUR_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "model" : "fountain-1 .0 " ,6 "input" : "Explain quantum computing in one sentence." ,7 "instructions" : "You are a helpful science assistant." 8 }'The response follows the Responses format with output_text as the main field.
{
"id": "resp-abc123",
"object": "response",
"created_at": 1700000000,
"model": "fountain-1.0",
"output": [
{
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Quantum computing uses quantum-mechanical phenomena like superposition and entanglement to process information in ways that classical computers cannot."
}
]
}
],
"usage": {
"input_tokens": 24,
"output_tokens": 28,
"total_tokens": 52
}
}Comparison between Chat Completions and Responses API.
| Feature | Chat API | Responses API |
|---|---|---|
| Endpoint | /chat/completions | /responses |
| Input | messages | input |
| System prompt | system role message | instructions |
| Response object | chat.completion | response |
| Response text | choices[0].message.content | output[0].content[0].text |
| Token usage | prompt_tokens / completion_tokens | input_tokens / output_tokens |
Send one text or a list of texts, get one vector per text back. For OpenAI-compatible SDKs use https://app.anymize.ai/api/v1/llm as the base URL.
/api/v1/llm/embeddingsThe model list with its dimensions and price is also available from the API: the same path with GET.
/api/v1/llm/embeddingsOne model, no decision to make. voyage-4-lite is tuned for speed and cost and fits search, similarity and RAG across large amounts of text.
| Property | Value |
|---|---|
| Model ID | voyage-4-lite |
| Context length (tokens per text) | 32,000 |
| Dimensions | 256, 512, 1,024, 2,048 |
| Dimensions (default) | 1,024 |
| Data types | float, int8, uint8, binary, ubinary |
| Texts per request | 1,000 |
| Price | 0.034 EUR per 1M tokens (1,700 credits) |
| Parameter | Type | Description |
|---|---|---|
inputrequired | string | string[] | A single text or a list of texts. |
model | string | Model ID. Leave it out and we use voyage-4-lite. |
input_type | "query" | "document" | null | What the text is for: "query" for a search query, "document" for the content you are making searchable. Setting it gives better hits than leaving it out. |
output_dimension | number | Vector length. Shorter means less storage in your index, longer means slightly more accuracy. |
output_dtype | string | Number format of the vectors. float is full resolution, int8 and binary save storage. |
truncation | boolean | Truncates over-long texts to the context length. Set it to false and you get an error instead. |
encoding_format | "base64" | null | Set to "base64" and the vectors come back as a Base64 string instead of a list of numbers. |
Vectors come back in the order of your texts, and index tells you which belongs to which.
1curl -X POST https://app.anymize.ai/api/v1/llm/embeddings \2 -H "Authorization: Bearer YOUR_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "input" : ["Der erste Text" , "Der zweite Text" ],6 "model" : "voyage-4 -lite" ,7 "input_type" : "document" 8 }'usage.total_tokens is what you are billed on. prompt_tokens carries the same value so OpenAI clients find it without any rewiring.
{
"object": "list",
"data": [
{
"object": "embedding",
"embedding": [
-0.012,
0.002,
0.031
],
"index": 0
},
{
"object": "embedding",
"embedding": [
0.008,
-0.002,
0.015
],
"index": 1
}
],
"model": "voyage-4-lite",
"usage": {
"total_tokens": 24,
"prompt_tokens": 24
}
}Embed query and content separately
You are billed on input tokens, there are no output tokens here. What a call cost is in the X-Anymize-Credits-Used response header and in the usage view of your developer console.
Limits and processing
Combine chat and anonymization in a single request — your data is masked before reaching the model.
/api/v1/llm-anonymous/chat/completionshttps://app.anymize.ai/api/v1/llm-anonymousHere's how anonymous chat processes your request:
Higher Latency
Same parameters as Chat Completions plus anonymization options.
| Parameter | Type | Description |
|---|---|---|
modelrequired | string | Model ID — all chat models are supported. |
messagesrequired | array | Array of messages (system, user, assistant). |
language | string | Text language for better PII detection. |
stream | boolean | Enable SSE streaming. |
In anonymous chat, personal data is automatically replaced with placeholders in the format [[Type-HASH]]. For de-anonymization to work, the model must preserve these placeholders exactly.
Wrong
Dear [name redacted], I am writing to you regarding...
Correct
Dear Mr. [[Person-ABC123]], I am writing to you regarding...
Without the right system prompt, the model often writes 'an anonymized person' or '[name redacted]' instead of using the placeholder [[Person-ABC123]]. This makes de-anonymization impossible.
The anonymous endpoint automatically appends the following part to your system prompt. It is added to your own system prompt, not replacing it:
1## CRITICAL RULE: ANONYMIZATION PLACEHOLDERS23THIS IS THE MOST IMPORTANT RULE. VIOLATING IT MAKES YOUR RESPONSE USELESS.45The user's messages contain anonymized placeholders shaped [[<Type>-<HASH>]],6where <Type> is the PII category (person, email, iban, telephone_number,7address, ...) and <HASH> is a short random code.89FORBIDDEN:10- Writing "[Name anonymisiert]" or "[anonymized]" 11- Describing WHAT the placeholder is instead of USING it12- Writing a double-bracket token that was NOT in the user's message — the hash13 is a database key, so an invented one resolves to nothing. Never copy a hash14 out of these instructions.1516REQUIRED:17- Copy each placeholder character-for-character from the user's message18- Use it inline like the real value: "Herr <placeholder> hat..." 19- Need a value the user never gave you? Use SINGLE brackets ([Name]).2021WHY: After your response, placeholders get replaced with real values.22BEFORE RESPONDING: Check that every double-bracket token also appears, character-for-character, in the user's message.Automatically injected
1curl -X POST https://app.anymize.ai/api/v1/llm-anonymous/chat/completions \2 -H "Authorization: Bearer YOUR_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "model" : "fountain-1 .0 " ,6 "messages" : [7 {"role" : "user" , "content" : "Schreibe eine E-Mail an Max Mustermann, max@example.com, wegen dem Termin am 15 . Januar." }8 ],9 "language" : "de" ,10 }'The response contains the de-anonymized text and metadata.
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "fountain-1.0",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Sehr geehrter Herr Max Mustermann,\n\nich schreibe Ihnen bezüglich unseres Termins am 15. Januar..."
},
"finish_reason": "stop"
}
],
"_anymize": {
"anonymized": true,
"job_id": "44444444-4444-4444-8444-444444444444",
"language": "de"
}
}Response header
Zero Data Retention
Anonymous chat consumes credits for two services:
Retrieve all available models and their metadata.
/api/v1/llm/modelsWaterfall 1 is being replaced
1curl https://app.anymize.ai/api/v1/llm/models \2 -H "Authorization: Bearer YOUR_API_KEY" The response contains an array of all models with ID, provider, and capabilities.
{
"object": "list",
"data": [
{
"id": "fountain-2.0",
"object": "model",
"owned_by": "anymize"
},
{
"id": "waterfall-2.0",
"object": "model",
"owned_by": "anymize"
},
{
"id": "fountain-1.0",
"object": "model",
"owned_by": "anymize"
},
{
"id": "claude-sonnet-4-5-20250514",
"object": "model",
"owned_by": "anthropic"
},
{
"id": "gpt-5",
"object": "model",
"owned_by": "openai"
},
{
"id": "gemini-2.5-flash",
"object": "model",
"owned_by": "google"
}
]
}Retrieve details for a specific model.
/api/v1/llm/models/{id}1curl https://app.anymize.ai/api/v1/llm/models/fountain-1 .0 \2 -H "Authorization: Bearer YOUR_API_KEY" {
"id": "fountain-1.0",
"object": "model",
"owned_by": "anymize"
}Models are grouped by provider — here's an overview.
| Provider | Models |
|---|---|
| Anthropic | Claude 4.5 Haiku, Claude Sonnet 4.6, Claude Sonnet 5.5, Claude Sonnet 5, Claude Opus 4.8, Claude Opus 5, Claude Opus 5.5, Claude Fable 5.2 |
| OpenAI | GPT-5 Mini, GPT-5.5, GPT-5.6 Sol, GPT-5.6 Terra, GPT-5.6 Luna, GPT-6 Astra, GPT-6 Sol, GPT-6.1 Sol, GPT-6.1 Terra, GPT-6 Luna |
| Gemini 2.5 Flash, Gemini 3.0 Flash, Gemini 3.1 Pro, Gemini 4 Argon, Gemini 4 Carbon, Gemini 4 Hydrogen | |
| Mistral | Mistral Medium 3 |
| Perplexity | Perplexity Pro |
| anymize | waterfall-2.0 (default), fountain-2.0, fountain-1.0 |
Token pricing varies by model and direction.
| Model | Input / 1M tokens | Output / 1M tokens |
|---|---|---|
fountain-1.0 | 1.00 EUR | 5.00 EUR |
fountain-2.0 | 0.072 EUR | 0.288 EUR |
waterfall-2.0 | 0.18 EUR | 0.60 EUR |
Claude Haiku 4.5 | 1.60 EUR | 8.00 EUR |
Claude Sonnet 4.6 | 4.20 EUR | 21.00 EUR |
Claude Sonnet 5.5 | 2.40 EUR | 12.00 EUR |
Claude Sonnet 5 | 3.60 EUR | 18.00 EUR |
Claude Opus 4.8 | 6.95 EUR | 34.70 EUR |
Claude Opus 5.5 | 4.80 EUR | 24.00 EUR |
Claude Opus 5 | 6.00 EUR | 30.00 EUR |
Claude Fable 5.2 | 11.20 EUR | 56.00 EUR |
Claude Fable 5.1 | 14.00 EUR | 70.00 EUR |
Claude Fable 5 | 14.00 EUR | 70.00 EUR |
GPT-5.5 | 6.30 EUR | 37.80 EUR |
GPT-5 Mini | 0.32 EUR | 2.55 EUR |
GPT-5.6 Sol | 6.50 EUR | 39.00 EUR |
GPT-5.6 Terra | 3.25 EUR | 19.50 EUR |
GPT-5.6 Luna | 1.30 EUR | 7.80 EUR |
GPT-6 Astra | 14.00 EUR | 70.00 EUR |
GPT-6 Sol | 2.60 EUR | 13.00 EUR |
GPT-6.1 Sol | 2.60 EUR | 13.00 EUR |
GPT-6.1 Terra | 1.30 EUR | 6.50 EUR |
GPT-6 Luna | 0.13 EUR | 0.65 EUR |
Gemini 2.5 Pro | 1.58 EUR | 12.60 EUR |
Gemini 3.5 Flash | 1.90 EUR | 11.35 EUR |
Gemini 3.1 Pro | 5.00 EUR | 25.00 EUR |
Gemini 4 Argon | 2.57 EUR | 12.84 EUR |
Gemini 4 Carbon | 2.57 EUR | 12.84 EUR |
Gemini 4 Hydrogen | 1.93 EUR | 9.63 EUR |
Mistral Medium 3 | 1.80 EUR | 9.00 EUR |
GLM 5.2 | 1.77 EUR | 5.55 EUR |
Perplexity Sonar Reasoning Pro | 5.00 EUR | 25.00 EUR |
Pricing note
Just replace the base URL in your existing setup. Everything else stays the same.
https://app.anymize.ai/api/v1/llmhttps://app.anymize.ai/api/v1/llm-anonymoushttps://app.anymize.ai/apiUse the official OpenAI SDK with anymize as base URL.
1import OpenAI from "openai" 23const client = new OpenAI({4 apiKey: "YOUR_API_KEY" ,5 baseURL: "https://app.anymize.ai/api/v1/llm" ,6})78const response = await client.chat.completions.create({9 model: "fountain-1 .0 " ,10 messages: [{ role: "user" , content: "Hello!" }],11})Universal compatibility
Set ANTHROPIC_BASE_URL to https://app.anymize.ai/api and auth with ANTHROPIC_AUTH_TOKEN. Do not use ANTHROPIC_API_KEY: it sends x-api-key and fails on custom gateways. Model ids match the console, e.g. anthropic/claude-sonnet-4.6.
AUTH_TOKEN, not API_KEY
1$env:ANTHROPIC_BASE_URL = "https://app.anymize.ai/api" 2$env:ANTHROPIC_AUTH_TOKEN = "YOUR_API_KEY" 3Remove-Item Env:ANTHROPIC_API_KEY -ErrorAction SilentlyContinue4$env:ANTHROPIC_MODEL = "anthropic/claude-sonnet-4 .6 " 5$env:ANTHROPIC_SMALL_FAST_MODEL = "anthropic/claude-haiku-4 .5 " 6claudeANTHROPIC_MODEL for the main loop, ANTHROPIC_SMALL_FAST_MODEL for side tasks (Haiku saves credits). Ids exactly as in the console.
OpenAI-compatible. Override the OpenAI base URL, paste the anymize key as the OpenAI API key, use a console model id.
1. Cursor Settings, Models section.
2. Override OpenAI Base URL: https://app.anymize.ai/api/v1/llm
3. OpenAI API Key = your anymize key. Then pick a console id, e.g. openai/gpt-5.4 or anthropic/claude-sonnet-4.6.
Under Connections point the OpenAI provider at https://app.anymize.ai/api/v1/llm, API key = anymize key. Models arrive via GET /models.
1OPENAI_API_BASE_URL=https://app.anymize.ai/api/v1/llm2OPENAI_API_KEY=YOUR_API_KEYModel provider OpenAI-API-compatible, API base https://app.anymize.ai/api/v1/llm, key = anymize key. Then the console id as the model name.
Provider OpenAI Compatible, base URL https://app.anymize.ai/api/v1/llm, API key = anymize key. Then the same model ids as in the console.
1{2 "cline.apiProvider" : "openai-compatible" ,3 "cline.openAiBaseUrl" : "https://app.anymize.ai/api/v1/llm" ,4 "cline.openAiApiKey" : "YOUR_API_KEY" ,5 "cline.openAiModelId" : "fountain-1 .0 " 6}In .continue/config.yaml add an OpenAI model with apiBase https://app.anymize.ai/api/v1/llm and apiKey. model is the full anymize id.
1models:2 - name: anymize3 provider: openai4 model: fountain-1 .0 5 apiBase: https://app.anymize.ai/api/v1/llm6 apiKey: YOUR_API_KEYChatOpenAI with base_url on .../api/v1/llm (no /chat/completions, LangChain appends the path). ChatAnthropic with anthropic_api_url on .../api.
1from langchain_openai import ChatOpenAI23llm = ChatOpenAI(4 model="fountain-1 .0 " ,5 api_key="YOUR_API_KEY" ,6 base_url="https://app.anymize.ai/api/v1/llm" ,7)LiteLLM can take anymize as an OpenAI-compatible upstream (api_base .../api/v1/llm) and expose OpenAI or Anthropic downstream. Useful when a tool only speaks one of the two protocols.
1model_list:2 - model_name: anymize-claude3 litellm_params:4 model: openai/anthropic/claude-haiku-4 .5 5 api_base: https://app.anymize.ai/api/v1/llm6 api_key: os.environ/ANYMIZE_API_KEYUse anymize directly in your n8n workflows. Set the base URL in the OpenAI Chat node or HTTP Request node.

Example: OpenAI Chat node in n8n with anymize base URL
1. Open the OpenAI Chat node in n8n and set the base URL to https://app.anymize.ai/api/v1/llm
2. Enter your anymize API key as Bearer token
3. Select a model (e.g. fountain-1.0) and start your workflow