API reference
Use a project API key for Chat Completions or Responses. Console cookie sessions and API Bearer authentication are separate.
Connection
| Setting | Value |
|---|---|
| Base URL | https://zeroclave.com/v1 |
| Chat Completions | POST https://zeroclave.com/v1/chat/completions |
| Authorization | Bearer $ZEROCLAVE_API_KEY |
Sign in to the console for project-specific endpoints, key management and available models. This documentation reads no session or private project data. Set ZEROCLAVE_API_KEY and ZEROCLAVE_MODEL; use a currently available model ID from the console.
Responses API
Call POST https://zeroclave.com/v1/responses with the same project API Key:
curl https://zeroclave.com/v1/responses \
-H "Authorization: Bearer $ZEROCLAVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"<MODEL_ID>","input":"Hello","store":false}'Platform Chat models support text, function tools, tool-result history and SSE (stream:true) through this endpoint. Output budgets, JSON formats and reasoning effort remain subject to model capabilities. Send supported conversation history and tool results explicitly in input.
Function tools must explicitly set strict:true or strict:false; this bridge does not normalize schemas or silently choose Chat's different default.
These models do not support server-side storage/continuation (store:true, previous_response_id), compaction, encrypted reasoning, built-in tools or image inputs. Omitted store means false; returned IDs cannot be retrieved or deleted. Unsupported parameters return responses_feature_not_supported instead of being silently ignored. Streaming retains output for the final response object; an upstream stream exceeding 64 MiB interrupts delivery without a successful terminal event.
Native Responses models and Zent BYOK retain their own supported features. Responses-only models cannot currently be called through Chat Completions.
Request parameters
| Parameter | Description |
|---|---|
model | Required; currently available model ID. |
messages | Required; array of conversation messages. |
stream | Optional; true enables SSE. |
max_tokens / max_completion_tokens | Optional; must be positive integers if supplied, not null or zero. Support and limits depend on the model. |
temperature, top_p, tools | Optional; support and allowed values depend on the model. |
DeepSeek tools and output budgets
DeepSeek thinking mode does not support tool_choice: "required" or a named function. Set thinking: {"type":"disabled"} for those choices; when thinking is omitted, reasoning_effort: "none" also disables thinking. Known parameter conflicts return HTTP 400 with code unsupported_parameter_combination and the relevant param. For streaming requests this is a JSON error before the first SSE frame. Correct the parameters before resubmitting.
DeepSeek's max_tokens includes both reasoning and final-answer tokens. A small budget may be consumed entirely by reasoning, producing empty content and finish_reason: "length"; this is not a transport failure. Increase the budget or disable thinking. Disabling thinking does not guarantee a complete answer within the chosen budget. ZeroClave does not automatically increase budgets or change thinking mode. Token parameter semantics differ between providers.
See the official DeepSeek Chat Completions documentation.
Examples
curl https://zeroclave.com/v1/chat/completions \
-H "Authorization: Bearer $ZEROCLAVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"<MODEL_ID>","messages":[{"role":"user","content":"Hello"}]}'import os
from openai import OpenAI
client = OpenAI(
base_url="https://zeroclave.com/v1",
api_key=os.environ["ZEROCLAVE_API_KEY"],
max_retries=0,
)
response = client.chat.completions.create(
model=os.environ["ZEROCLAVE_MODEL"],
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://zeroclave.com/v1',
apiKey: process.env.ZEROCLAVE_API_KEY,
maxRetries: 0,
});
const response = await client.chat.completions.create({
model: process.env.ZEROCLAVE_MODEL,
messages: [{ role: 'user', content: 'Hello' }],
});
console.log(response.choices[0].message.content);Replace <MODEL_ID> in the curl example. Install the openai package for Python or Node.js. SDK automatic retries are disabled here; decide retries based on outcomes and business side effects.
Streaming requests
with client.chat.completions.create(
model=os.environ["ZEROCLAVE_MODEL"],
messages=[{"role": "user", "content": "Hello"}],
stream=True,
) as stream:
for chunk in stream:
if chunk.choices:
print(chunk.choices[0].delta.content or "", end="", flush=True)This uses the Python client above. Generation can fail mid-stream; read Streaming and Errors.
Models and quota
curl https://zeroclave.com/v1/models -H "Authorization: Bearer $ZEROCLAVE_API_KEY"
curl https://zeroclave.com/v1/quota -H "Authorization: Bearer $ZEROCLAVE_API_KEY"Models, capabilities and quota depend on the current project and service configuration. Do not rely on historical model lists or pricing in PDFs.
Limits and troubleshooting
Public 402 means insufficient ZeroClave account or project quota; 429 means ZeroClave caller rate limiting. Model service failures use 502/503/504 model_unavailable and do not imply an invalid user key or insufficient user quota. HTTP 503 can also carry pii_mapping_saturated: stop automatic retries and contact an administrator or support with X-Request-ID. This capacity error does not include Retry-After. For ordinary rate limits, respect Retry-After when available; it is a response header, not a JSON body field. See Error Codes.
Privacy boundary
Detection can miss sensitive information. Images, vision inputs and raw files are not covered by the text PII masking guarantee; check what your client actually sends.
Standard API access uses HTTPS. Changing the endpoint and API key does not enable end-to-end encryption or strict remote attestation.

