Request reference

The fields and headers of the three chat routes, as the network handles them: POST /v1/chat/completions (OpenAI Chat Completions), POST /v1/messages (Anthropic Messages, which Claude Code speaks) and POST /v1/responses (OpenAI Responses, which Codex speaks).

POST /v1/chat/completions

Each row was sent to the network and checked on 25 September 2026, except the model row and the PII example's model id, which changed on 15 November 2026 (the model row again on 18 November 2026, the model id again on 26 November 2026), and the image parts, added on 25 and 26 November 2026.

Body fields

FieldWhat it does
modelA model id from /v1/models. A name no deployed model has is refused with 404 model_not_found, never answered by another model. An empty or missing model is answered by the deployed model only while exactly one public one is deployed: a model marked internal in /v1/models does not count, nor does a LoRA. With none it gets 503, and with several 400 model_required, whose message names them to pick from.
messagesThe conversation, in OpenAI format. Required; an empty list is rejected. On a model that reads images, a user message can carry them; see Images.
max_tokens / max_completion_tokensUpper limit on generated tokens. Set it: without a limit the reply runs until the model stops. 0 returns one token.
temperatureFrom 0 to 2. The default is 0, which returns the same reply to the same request.
top_pFrom 0 to 1. The default is 1.
top_kSample only from the k most likely tokens. The default, 0, means no limit.
seedWith a temperature above 0, the same seed and the same request return the same reply.
stopA string or a list of strings. Generation stops before the first match, with finish_reason stop.
repetition_penaltyPenalizes repeated tokens. Use it instead of presence_penalty and frequency_penalty.
streamtrue sends the reply as server-sent events, ending with data: [DONE].
tools / tool_choiceFunction tools in OpenAI format. When the model calls one, the reply carries tool_calls and finish_reason: tool_calls.
redact_piitrue scrubs personal data from the prompt before it reaches a node. See Redact PII.
response_formatOnly {"type": "text"} is accepted.

Headers

HeaderWhat it does
Authorization: Bearer YOUR_API_KEYYour API key. The public network answers a request without one with 401; see Use the network.
x-auto-redact: 1Same as redact_pii: true.
X-Conversation-IdOn the long entries, qwen3.8-27b-64k, qwen3.8-27b-128k and qwen3.8-27b-256k, send the same id with every turn of a conversation to keep it on the node that holds it. On other models a turn can still go to another replica.

The API does not encrypt a request end to end: the coordinator reads each request in plaintext (see Security). A request that asks for it with x-encrypt-all-fields: true (in any letter case) or 1 is refused and never served: with x-encryption-version: 1 it gets 501 and the code encryption_not_active, and it gets 400 without a version (encryption_version_missing), with any other version such as 2 (encryption_version_unsupported) or with a value that is not a version number such as v1 (encryption_version_malformed). Any other value of x-encrypt-all-fields, such as false or 0, is ignored. Before this header is read, a request without a valid API key gets 401, and a body the route cannot read gets its own error, such as 400 for malformed JSON.

Rejected with 400

These are part of the OpenAI API but not supported here. The error message says why.

FieldWhy
nAbove 1: the API returns exactly one choice per request.
best_ofNot supported on /v1/chat/completions.
logprobsNot supported on /v1/chat/completions.
response_formatAnything other than text, such as json_object.
presence_penalty / frequency_penaltyAny value other than 0. Use repetition_penalty.
logit_biasNot supported. Use repetition_penalty.
suffixInsertion mode is not implemented.
stream_options.include_usageThe stream sends no final usage chunk.
temperature, top_pValues outside 0–2 and 0–1.

Images

A model whose entry in /v1/models lists image in input_modalities reads images; the entry lists it only while a node that can read them is ready. A user message's content is then a list of parts, text and image_url, in the order the model reads them. An image's url is a base64 data: URL, or an http(s) URL the coordinator fetches:

Terminal
curl https://coordinator.holonear.app/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3.8-27b-8k",
    "messages": [{"role": "user", "content": [
      {"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}},
      {"type": "text", "text": "What is in this photo?"}
    ]}],
    "max_tokens": 256
  }'
  • Formats and caps. PNG, JPEG and WebP stills: no GIF, no animation. At most 16 images a request, except on the long entries (below); each side at most 8,192 px, and the long side at most 200 times the short one. A fetched image is at most 16 MiB and must arrive within 10 seconds, from a host that resolves to public addresses only and with no redirect. A request's fetched images take at most 32 MiB together, and its images at most 14 MiB once the coordinator has encoded them again (below). The whole body is at most 32 MiB, and base64 makes an image a third larger.
  • What reaches the node. The coordinator decodes each image, turns it upright by its EXIF orientation, flattens transparency onto white, resizes it and encodes it again as a PNG with no metadata: no EXIF (GPS included), no text, no colour profile. Only that PNG reaches the node. redact_pii scrubs the text, not the pixels: text in an image reaches the node as it is.
  • Tokens. An image is resized to sides that are multiples of 32 px, close to its aspect ratio, between 65,536 and 1,048,576 pixels. It then takes (h/32)·(w/32) tokens, h and w its new height and width, plus two tokens that mark its start and end: 66 to 1,026 an image, about as many as its own size gives. A 4032 × 3024 photo becomes 1152 × 864, 974 tokens; a 1280 × 720 frame becomes 1280 × 704, 882 tokens. They take room in the window: the everyday entry's 8,192 tokens hold about seven images at the cap.
  • detail on an image_url: "auto", the default, and "high" keep the cap above; "low" caps the image at 262,144 pixels, 258 tokens with its two marks. Any other value gets 400 invalid_request.
  • Billing. An image's tokens, its two marks among them, are prompt tokens: they count in usage.prompt_tokens and are billed at the model's input price.
  • The long entries, such as qwen3.8-27b-64k, read no images and list only text: each image becomes the text [image omitted] where it was, however many there are, and nothing is fetched or decoded. The 32 MiB body limit still holds.
  • Video is not served: a video_url part gets 400 unsupported_content_type.
  • Text only: POST /v1/inference/sealed, which takes token ids; Rust calls to a node on your own network; the Qwen 27B under holonear serve, where an image gets 400 image_input_unsupported; and the Batch API, which refuses a line with an image.

An image request is refused before any node is asked, with the field it names in param:

Status and codeWhen
400 image_input_unsupportedThe model reads no images, or the coordinator takes none.
503 image_replica_unavailableThe model reads images, but no node that can read them is ready. It carries Retry-After: 10.
400 adapter_image_unavailableThe model is a LoRA registered from its bytes, and no node that reads images holds it. No retry serves it; a request of text only under it still does.
503 media_busyThe coordinator's image queue stayed full. It carries Retry-After: 5.
400 too_many_imagesMore than 16 images, except on the long entries.
400 invalid_imageNot PNG, JPEG or WebP; does not decode; animated; a side over 8,192 px; an aspect ratio over 200; more than 256 MiB once decoded; a data: URL that is not base64.
400 image_fetch_failedA fetched image failed: its status, the 10 s timeout, more than 16 MiB, a redirect or an address that is not public.
413 media_too_largeThe fetched images take more than 32 MiB, or the images more than 14 MiB once encoded again.
400 unsupported_content_typeA video part.
400 invalid_requestAn image in a system message, a detail other than the three above, or an image beside prompt_tokens.

Redact PII

With redact_pii: true (or x-auto-redact: 1), the network replaces emails, phone numbers, card numbers, SSNs, IP addresses and secrets (an API key that starts with a known prefix, such as sk- or AKIA, or a JWT) in the prompt with placeholders such as <email1> or <secret1> before the prompt reaches a node. The model only sees the placeholder, so it answers with it too:

Terminal
curl https://coordinator.holonear.app/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3.8-27b-8k",
    "redact_pii": true,
    "messages": [{"role": "user", "content": "Repeat exactly: my email is [email protected] /no_think"}],
    "max_tokens": 64
  }'

Redaction covers every message in the request it is sent with. The dashboard Chat sends the whole conversation with every message, so while the conversation holds a message that went out redacted, Chat keeps "Redact PII" on: a new chat frees it. A message that fails, or that you stop, before its reply begins goes back into the message box and out of the conversation, so it no longer holds the switch.

The API redacts per request. From your own code, send redact_pii (or the header) with every request of a conversation: a request without it reaches the node as written, the earlier messages it carries included.

POST /v1/messages

The Anthropic Messages format, which the Anthropic SDKs and Claude Code speak. Send the key as a bearer, not in x-api-key: see its headers.

Each row was sent to a running coordinator and checked on 13 November 2026, except the model row, which changed on 15 November 2026 (its two refusals with no model deployed were checked on 17 November 2026, and its refusal with several deployed on 18 November 2026), how the long entry routes a conversation, and images, which follow the coordinator's own tests of 25 and 26 November 2026.

Body fields

FieldWhat it does
modelA model id from /v1/models. A name no deployed model has gets 404 and the type not_found_error; another model never answers under it. An empty or missing model is answered by the deployed model only while exactly one public one is deployed: a model marked internal in /v1/models does not count, nor does a LoRA. With none it gets 503 and overloaded_error, and with several 400 and invalid_request_error, whose message names them to pick from.
max_tokensRequired, at least 1. Upper limit on generated tokens, the reasoning included. A value above the room left in the model's window is cut to that room.
messagesThe conversation. Required; an empty list is rejected. A message's content is a string or a list of blocks: text, tool_use in an assistant message, tool_result in a user message, and image in a user message or in a tool_result's content; see Images. A thinking block is accepted and left out of the prompt.
systemThe system prompt: a string or text blocks. system messages are taken too: those at the start of messages join it, and the text of a later one goes to the model as user text at that point in the conversation.
temperatureFrom 0 to 1. The default is 0, which returns the same reply to the same request (Anthropic's own default is 1).
top_p / top_kAs on /v1/chat/completions.
stop_sequencesUp to 4 strings of at most 256 bytes each. Generation stops before the first match, with stop_reason: stop_sequence and the match in stop_sequence. A match right after a tool call stops for the call: stop_reason: tool_use, and no sequence is named.
streamtrue sends the reply as server-sent events; see Streaming.
toolsTools in Anthropic format (name, description, input_schema). When the model calls one, the reply carries tool_use blocks and stop_reason: tool_use. Works with stream: true.
thinking{"type": "disabled"} turns reasoning off. {"type": "adaptive"}, with or without display, keeps the model's default, as a missing or null value does. {"type": "enabled", "budget_tokens": N} turns it on; budget_tokens is not enforced, so the reasoning counts toward max_tokens. The reasoning comes back as a thinking block before the text.
chat_template_kwargs{"enable_thinking": false} turns reasoning off, as on /v1/chat/completions.
redact_piiAs on /v1/chat/completions: see Redact PII.

The reply's stop_reason is end_turn, max_tokens, stop_sequence or tool_use. Each tool_use block has an id of its own (toolu_…), never repeated across replies. In a reply sent whole, usage splits the prompt: input_tokens counts the tokens the node read, and cache_read_input_tokens (left out when 0) those it reused from an earlier request. A stream reports the whole prompt as input_tokens. output_tokens counts the reply, its reasoning included. A thinking block carries signature: "holonear-unsigned": no open model signs its reasoning.

Images

  • An image block's source is base64 (a PNG, JPEG or WebP in data) or a url. A Qwen model whose input_modalities in /v1/models lists image, such as qwen3.8-27b-8k, reads it, and its tokens count in input_tokens, billed as text. A Gemma-3 model takes images on /v1/chat/completions only. Up to 16 images a request.
  • On the long entries each image becomes the text [image omitted] where it was, in a user message or a tool result, and nothing of it is fetched or read. There the count is not capped, since a session resends every screenshot it took; the 32 MiB limit on a request body still holds.
  • A model that takes no image refuses one with 400; while no node that reads images is ready, the request gets 503, overloaded_error and Retry-After. A LoRA registered from its bytes that no node that reads images holds refuses an image with 400, and no retry serves it; a request of text only under it still does. This shape has no code field, so an image's error message starts with its code, then the block it names, if any: for example image_input_unsupported: messages[0].content[1]: … or adapter_image_unavailable: ….

Headers

HeaderWhat it does
Authorization: Bearer YOUR_API_KEYYour API key, as on /v1/chat/completions. With the Anthropic SDK, pass it as auth_token.
x-api-keyNot read, so on the public network a key sent only here gets 401. Older Anthropic SDKs send their api_key here; auth_token always goes in Authorization.
anthropic-version / anthropic-betaAccepted and not read.
x-auto-redact: 1Same as redact_pii: true.
X-Conversation-IdOn the long entries, qwen3.8-27b-64k, qwen3.8-27b-128k and qwen3.8-27b-256k, send the same id with every turn of a conversation to keep it on the node that holds it. Without it, Claude Code's x-claude-code-session-id does the same. On other models a turn can still go to another replica.

No end-to-end encryption here either: x-encrypt-all-fields is refused as on /v1/chat/completions, in the Anthropic error shape. With x-encryption-version: 1 it gets 501 and the type api_error; without a version, or with any version other than 1, it gets 400 and the type invalid_request_error. The error carries no code; its message names the cause.

Rejected with 400

FieldWhy
max_tokensMissing, or 0.
messagesEmpty; a role other than user, assistant, system, developer or tool; a tool_use outside an assistant message, or without a name and an object input; a tool_result outside a user message, or whose content is not a string or text and image blocks; an image outside a user message, or in system (invalid_request); an image source of type file (unsupported_content_type) or of another type than base64 and url; more than 16 images, except on a long entry (too_many_images); an image that is not a PNG, JPEG or WebP still, or does not decode (invalid_image).
temperature, top_pValues outside 0–1.
stop_sequencesMore than 4, or one longer than 256 bytes.
thinkingAny value other than those above, such as enabled without a whole budget_tokens, or one that contradicts chat_template_kwargs.enable_thinking. Turning reasoning on or off is refused on a model whose chat template cannot switch it.
The promptFills the model's window: token_budget_exhausted.

Accepted and ignored

These are read without an error and change nothing.

FieldWhat happens
tool_choiceNot read. With tools set, the model may call any of them, as with auto.
metadataNot read.
cache_controlNot read, on any block.
documentA document block is left out of the prompt.
is_error on a tool_resultNot read: the result's text goes to the model as it is.
Other fieldsNot read, such as context_management and output_config, which Claude Code sends.

Streaming

  • Events, in order: message_start; each content block as content_block_start, its content_block_delta events and content_block_stop; message_delta with stop_reason and usage; then message_stop, which ends the stream. There is no data: [DONE].
  • A thinking model's reasoning comes as a thinking block: thinking_delta events, then one signature_delta. It comes first, unless the keep-alive below opened an empty text block before the model started to reason.
  • With tools, text goes out as it is decoded. Each call is a tool_use block whose one input_json_delta holds the whole input, sent once the call is complete.
  • When nothing has gone out for 15 seconds, while a long prompt is read or a call is held, the stream sends an empty delta on the open block, or opens a text block for it. It counts no tokens. There are no ping events.
  • If the reply fails mid-stream, the stream sends one error event and ends, with no message_stop.

Count tokens

POST /v1/messages/count_tokens takes the prompt fields of a Messages request (model, messages, system, tools, thinking, chat_template_kwargs, redact_pii) and answers {"input_tokens": N}: the prompt as /v1/messages reads and bills it, tools included. It takes the same key and answers its errors in the same Anthropic shape, and a prompt too long for the window is counted too. Nothing is generated or charged. An image is counted as a reply bills it, from its size alone, read from its header: an image whose pixels do not decode is counted here and refused by /v1/messages. On a long entry it counts as its [image omitted] text.

POST /v1/responses

The OpenAI Responses format, which the OpenAI SDK's responses.create and Codex speak. A stored reply can be continued with previous_response_id.

Each row was sent to a running coordinator and checked on 13 November 2026, except the model row, which changed on 15 November 2026 and again on 18 November 2026, how the long entry routes a conversation, and images, which follow the coordinator's own tests of 25 and 26 November 2026.

Body fields

FieldWhat it does
modelA model id from /v1/models. A name no deployed model has gets 404 and model_not_found; another model never answers under it. An empty or missing model is answered by the deployed model only while exactly one public one is deployed: a model marked internal in /v1/models does not count, nor does a LoRA. With none it gets 503, and with several 400 model_required, whose message names them to pick from.
inputA string, or a list of items: messages, function_call and function_call_output items, and reasoning items, which are accepted and left out of the prompt. A message's content is a string or a list of parts with text, and, in a user message or a function_call_output's output, input_image parts: an image_url (a data: or http(s) URL of a PNG, JPEG or WebP) and a detail of auto, low or high. Images are read, counted and billed as on /v1/messages, with the same refusals, by code and param: an image under a LoRA registered from its bytes that no node that reads images holds is 400 adapter_image_unavailable, naming model. On the long entries each becomes the text [image omitted], however many there are.
instructionsThe system prompt. system and developer messages at the start of input join it, and the text of a later one goes to the model as user text at that point. With previous_response_id, it replaces the earlier reply's instructions.
max_output_tokensUpper limit on generated tokens, the reasoning included. Without it the reply runs until the model stops or its window is full. A reply cut at the limit has status: "incomplete" and incomplete_details.reason: "max_output_tokens".
temperatureFrom 0 to 2. The default is 0, which returns the same reply to the same request.
top_p / top_kAs on /v1/chat/completions.
streamtrue sends the reply as server-sent events; see Streaming.
toolsFunction tools, in the Responses shape ({"type": "function", "name": …, "parameters": …}) or the chat one. When the model calls one, output carries a function_call item. Works with stream: true. A file_search tool, {"type": "file_search", "documents": [{"id": …, "text": …}]}, is run by the network itself: a text search over the documents sent with it, whose result goes back to the model before it answers. The documents are part of the prompt too: they take room in the window and count toward input_tokens. output carries the call and its function_call_output. Without streaming only.
tool_choice"none" offers the model no tools. Any other value is read as auto.
previous_response_idContinues the conversation of an earlier, stored reply. An unknown or expired id gets 404 and previous_response_not_found, and so does another account's: only the account that stored a reply can continue it. No image is stored: a conversation that sent images gets 400 and images_not_stored, so send it again whole. One whose images were each [image omitted] continues.
storetrue by default: the reply and its conversation are kept, so previous_response_id can continue them. false keeps nothing on the network.
reasoning{"effort": "none"} turns reasoning off; a missing or null value, {} and "effort": null keep the model's default. summary is accepted, a string or null, and none is written: a reasoning item carries summary: [].
chat_template_kwargs{"enable_thinking": true} or false turns reasoning on or off, as on /v1/chat/completions.
prompt_cache_keyOn the long entry, keeps requests with the same key on the node that holds them, as X-Conversation-Id does. Not stored.
redact_piiAs on /v1/chat/completions; a stored conversation keeps the placeholders too.

With redact_pii, a file_search tool's documents are redacted too: every string and number in them, their id and text included, in the same pass as the instructions and the input. A value they share gets the same placeholder, and the search runs on the redacted text, so its results name a document by its redacted id. The documents' keys and the rest of the tool definitions reach the node as sent. The model's search query is redacted separately, its placeholders numbered from 1 again, so a query that writes a value out, instead of copying a placeholder, matches no document.

output holds a reasoning item first when the model thinks, then the message and any function_call items. Each call's call_id (call_…) is never repeated across responses. In usage, input_tokens is the whole prompt and input_tokens_details.cached_tokens the part of it the node reused from an earlier request, streamed or not; output_tokens_details.reasoning_tokens is the part of output_tokens the reasoning took.

Headers

HeaderWhat it does
Authorization: Bearer YOUR_API_KEYYour API key, as on /v1/chat/completions.
x-auto-redact: 1Same as redact_pii: true.
X-Conversation-IdOn the long entries, qwen3.8-27b-64k, qwen3.8-27b-128k and qwen3.8-27b-256k, send the same id with every turn of a conversation to keep it on the node that holds it. Without it, prompt_cache_key does the same. On other models a turn can still go to another replica.

No end-to-end encryption here either: x-encrypt-all-fields is refused as on /v1/chat/completions, with the same statuses and codes.

Rejected with 400

FieldWhy
inputA role other than user, assistant, system, developer or tool, or a function_call without a name and arguments holding a JSON object (invalid_tool_call); an input_file part, or an input_image by file_id (unsupported_content_type); an input_image without image_url, in a message that is not a user's, or with another detail (invalid_request).
temperature, top_pValues outside 0–2 and 0–1 (invalid_sampling_control).
reasoningNot an object; a key other than effort and summary; an effort other than "none" or null, since reasoning levels are not supported; a summary that is not a string or null; a value that contradicts chat_template_kwargs.enable_thinking. Turning reasoning on or off is refused on a model whose chat template cannot switch it.
toolsA file_search tool with stream: true: it runs on the network, and only without streaming.
The promptFills the model's window: token_budget_exhausted.

Accepted and ignored

These are read without an error and change nothing.

FieldWhat happens
includeNot read.
parallel_tool_callsNot read: the model may make several calls in one reply.
textNot read: the reply is plain text.
Tools of other typesweb_search, custom and other non-function tools, except file_search, are left out: the model is not told of them, and nothing runs them.
Other fieldsNot read.

Streaming

  • Events: response.created, each output item, then response.completed, whose output lists every item and which ends the stream. Every event carries an increasing sequence_number, and its SSE event: name is its type. There is no data: [DONE].
  • A message item is response.output_item.added, response.content_part.added, the response.output_text.delta events, response.output_text.done, response.content_part.done and response.output_item.done.
  • A thinking model's reasoning comes first, as a reasoning item whose text arrives in response.reasoning_text.delta events.
  • With tools, text goes out as it is decoded, in a message item only when there is text. Each call is a function_call item: response.output_item.added, response.function_call_arguments.delta and .done, then response.output_item.done with call_id, name and arguments.
  • When nothing has gone out for 15 seconds, while a long prompt is read or a call is held, the stream sends response.in_progress. It counts no tokens.
  • If the reply fails mid-stream, the stream sends an error event, then response.failed.

Other endpoints

  • POST /v1/completions — plain text completion from a prompt.