API reference
Use a project API key for OpenAI-compatible Chat Completions. 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.
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. |
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.

