Skip to main content
Get your AI agent routed through the Avaliar Proxy in three steps. The only changes required are your endpoint URL and adding your Avaliar API key to the request body.
1

Get a Proxy API Key

Generate an API key from the Avaliar Dashboard.
  1. Navigate to Settings → API Keys
  2. Click Create API Key
  3. Select the Proxy scope
  4. Copy the generated key — you won’t be able to see it again
Never expose your Avaliar API key in client-side or browser-based code. Use it only in server-side applications or backend AI agent services.
2

Update Your Endpoint URL

Replace your LLM provider’s endpoint URL with the corresponding Avaliar Proxy URL, and add your api_key to the request body.The proxy has a dedicated endpoint per provider:
ProviderProxy Endpoint
OpenAIPOST https://proxy.avaliar.ai/api/openai_service/chat_completion
AnthropicPOST https://proxy.avaliar.ai/api/anthropic_service/chat_completion
Google GeminiPOST https://proxy.avaliar.ai/api/gemini_service/chat_completion
Your existing provider API key (OpenAI key, Anthropic key, etc.) stays in the request body exactly where it was. Just add api_key alongside it.
import requests

response = requests.post(
    "https://proxy.avaliar.ai/api/openai_service/chat_completion",
    json={
        "api_key": "your-avaliar-api-key",        # Avaliar key — new
        "openai_api_key": "your-openai-key",       # Your existing OpenAI key
        "model": "gpt-4o",
        "messages": [
            {"role": "user", "content": "Hello!"}
        ]
    }
)
If you omit your provider API key (e.g. openai_api_key), the proxy will use a server-side key. Contact support to confirm whether this is enabled for your plan.
3

View Traces in the Dashboard

Open the Avaliar Dashboard to see your traces appear in real time.Each trace includes:
  • Full prompt and response content
  • Provider, model, and token counts
  • End-to-end latency and proxy overhead
  • Safety detection results and any identified issues
  • Cost estimates
Make a single test request after setup and check the Traces page. A trace should appear within a few seconds.

Request Parameters

All proxy endpoints accept the same parameters as the underlying LLM provider, plus a few Avaliar-specific ones.

Avaliar-Specific Parameters

ParameterTypeRequiredDescription
api_keystringYesYour Avaliar API key, generated from the dashboard
is_confidentialbooleanNoIf true, the prompt and response are not stored in traces. Defaults to false

Provider API Key Parameters

ParameterProviderDescription
openai_api_keyOpenAIYour OpenAI API key. If omitted, the proxy uses a server-side key
anthropic_api_keyAnthropicYour Anthropic API key. If omitted, the proxy uses a server-side key
gemini_api_keyGeminiYour Google Gemini API key. If omitted, the proxy uses a server-side key
All other parameters (model, messages, temperature, max_tokens, etc.) are passed through to the provider unchanged. See the Supported Models page for available model IDs.

Confidential Requests

If a request contains sensitive information that should not be stored, set is_confidential: true. The proxy will still forward the request to the LLM provider and count it in your usage metrics, but the prompt and response content will not be saved to Avaliar.
requests.post(
    "https://proxy.avaliar.ai/api/openai_service/chat_completion",
    json={
        "api_key": "your-avaliar-api-key",
        "model": "gpt-4o",
        "messages": [{"role": "user", "content": "Sensitive content here"}],
        "is_confidential": True   # Prompt and response are not stored
    }
)
Detection does not run on confidential requests. Token counts and latency are still tracked.

Error Handling

If the proxy rejects a request, it returns a JSON error response:
{
  "is_successful": false,
  "message": "Invalid or revoked API key"
}
Common error codes:
StatusCause
401Invalid, expired, or revoked Avaliar API key
400Missing required parameters or invalid request body
422Request body failed schema validation
403Request blocked — prompt injection detected
500Internal error or LLM provider failure
If a request is blocked due to prompt injection, the response will indicate the block reason. The blocked request is still recorded as a trace on the Avaliar platform.