Skip to main content

cURL Integration

cURL is the quickest way to test VaultProxy. All examples below can be pasted directly into your terminal.

Basic Request

curl -X POST https://api.vaultproxy.ai/v1/chat/completions \
-H "Authorization: Bearer vpx_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "What is the capital of Poland?"}
]
}'

Using Different Models

Anthropic Claude

curl -X POST https://api.vaultproxy.ai/v1/chat/completions \
-H "Authorization: Bearer vpx_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-4.6-sonnet",
"messages": [
{"role": "user", "content": "Explain quantum computing in simple terms."}
]
}'

Google Gemini

curl -X POST https://api.vaultproxy.ai/v1/chat/completions \
-H "Authorization: Bearer vpx_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-2.5-pro",
"messages": [
{"role": "user", "content": "Hello from Gemini!"}
]
}'

Bielik (Polish Model)

curl -X POST https://api.vaultproxy.ai/v1/chat/completions \
-H "Authorization: Bearer vpx_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "bielik/bielik-13b-pro",
"messages": [
{"role": "user", "content": "Opowiedz mi o historii Krakowa."}
]
}'

System Messages

curl -X POST https://api.vaultproxy.ai/v1/chat/completions \
-H "Authorization: Bearer vpx_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "system", "content": "You are a Polish legal expert. Answer in Polish."},
{"role": "user", "content": "Czym jest RODO?"}
],
"temperature": 0.5,
"max_tokens": 1000
}'

Inspecting the Anonymized Prompt

Add the X-Show-Raw-Prompt: true header to see exactly what VaultProxy sends to the AI provider after PII anonymization. The anonymization details are returned in the X-Anonymization-Info response header as base64-encoded JSON.

curl -v -X POST https://api.vaultproxy.ai/v1/chat/completions \
-H "Authorization: Bearer vpx_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Show-Raw-Prompt: true" \
-d '{
"model": "google/gemini-2.5-flash",
"messages": [
{"role": "user", "content": "Summarize this: Jan Kowalski, PESEL 85031501234, email [email protected], phone +48 600 123 456"}
]
}'

The response body is a normal OpenAI-compatible response (with de-anonymized data). The response header X-Anonymization-Info contains the base64-encoded anonymization details:

# Decode the header to see what AI actually received:
echo "BASE64_VALUE_FROM_HEADER" | base64 -d | python3 -m json.tool
{
"anonymized_messages": [
{
"role": "user",
"content": "Summarize this: <PERSON_1>, PESEL <PESEL_1>, email <EMAIL_ADDRESS_1>, phone <PHONE_NUMBER_1>"
}
],
"raw_llm_response": "<PERSON_1>, with PESEL <PESEL_1>, resides in...",
"entities_found": 4,
"entity_types": ["PERSON", "PESEL", "EMAIL_ADDRESS", "PHONE_NUMBER"],
"mapping": {
"<PERSON_1>": "***",
"<PESEL_1>": "***",
"<EMAIL_ADDRESS_1>": "***",
"<PHONE_NUMBER_1>": "***"
}
}
info

The mapping field shows tags but masks actual values with *** for security. The real values are only used internally for de-anonymization and are never exposed in headers.


## Health Check

Verify that VaultProxy is running and reachable:

```bash
curl https://api.vaultproxy.ai/v1/health

Expected response:

{
"status": "ok",
"version": "1.0.0"
}

Streaming

curl -X POST https://api.vaultproxy.ai/v1/chat/completions \
-H "Authorization: Bearer vpx_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-N \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "Write a haiku about Warsaw."}
],
"stream": true
}'
tip

The -N flag disables output buffering so you see tokens as they arrive.

Common Options

ParameterTypeDescription
modelstringModel identifier (required)
messagesarrayConversation messages (required)
temperaturefloatRandomness, 0.0 to 2.0 (default: 1.0)
max_tokensintegerMaximum response tokens
streambooleanEnable streaming (default: false)
top_pfloatNucleus sampling threshold
stopstring/arrayStop sequences

Error Responses

# 401 - Invalid API key
curl -X POST https://api.vaultproxy.ai/v1/chat/completions \
-H "Authorization: Bearer invalid_key" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-4o", "messages": [{"role": "user", "content": "test"}]}'
{
"error": {
"type": "authentication_error",
"message": "Invalid API key provided."
}
}