Skip to main content
The PromptGuard API is fully compatible with OpenAI’s API structure, making it a seamless drop-in replacement for your existing integrations.

Overview

PromptGuard provides two types of APIs: As a customer you will see two path families: /api/v1/* is the API-key-authenticated Developer API documented in this reference, while app.promptguard.co uses its own session-authenticated Dashboard API that is not part of the public API surface.

Authentication

All PromptGuard API endpoints require authentication. For the Developer API, you’ll use two keys:
  1. PromptGuard API key (in X-API-Key header) - Authenticates your PromptGuard account
  2. LLM provider key (in Authorization header) - Your OpenAI/Anthropic key that gets forwarded to the provider

Developer API Authentication

For detailed authentication setup and code examples, see the Quickstart.

Dashboard API Authentication

For dashboard applications, use session-based authentication:

Base URLs

/api/v1/proxy/... also works. Every endpoint below is mounted a second time under a /proxy prefix — /api/v1/guard and /api/v1/proxy/guard are the same endpoint with the same behaviour. If you already call the /proxy form, it keeps working and there is nothing to migrate.This reference documents the shorter /api/v1/... form only. Publishing both produced two pages per endpoint, which left search engines and coding assistants guessing at which URL was canonical. Prefer /api/v1/... in new code.

Available Endpoints

Chat Completions (OpenAI Compatible)

The primary endpoint for AI requests. Fully compatible with OpenAI’s API:
Supported parameters:
  • model - Any supported LLM model (OpenAI, Anthropic, Google, Mistral, DeepSeek, Cohere, Groq, Azure OpenAI). See Supported LLM Providers for complete model list
  • messages - Array of message objects
  • temperature, max_tokens, top_p, etc.
  • stream - Enable streaming responses
  • user - Unique user identifier for tracking

Messages (Anthropic Compatible)

Anthropic-style messages endpoint for native Anthropic SDK integrations (messages.create()). Routes through the same policy engine as /chat/completions:

Guard API

Scan content for threats without proxying to an LLM provider. Accepts structured messages with direction and context:
See Guard API reference for full documentation.

Security Scan

Analyze raw text for prompt injection, jailbreaks, and other threats:

Security Redact

Strip PII from text and return both original and redacted versions:
See Security Scan & Redact reference for full documentation.

Agent Security

Validate tool calls and monitor agent sessions:
See Agent Security reference for full documentation.

Models

List available models:

Usage Statistics

Get your current usage:

Policies

List the active policies enforced for your API key’s project (project policies plus account-level global policies, highest priority first). Policies are created and edited in the dashboard — this endpoint is read-only:

Device Enrollment

Enroll a device (used by the desktop agent and CLI):

Exceptions

Create and manage temporary policy exceptions:

Tool Requests

Request and track approval for blocked tools:

GitHub Webhook

Receiver for PromptGuard GitHub App webhook events (called by GitHub, not by your code):
Core endpoints are also mounted under a /api/v1/proxy/* alias (e.g. POST /api/v1/proxy/chat/completions) for backwards compatibility. New integrations should use the /api/v1/* paths.

Rate Limits

PromptGuard applies two independent limits, both scoped per account (not per API key): Per-minute rate limit (requests per minute): Monthly request quota (per account):
Infrastructure anti-abuse limit: A separate Cloud Armor layer enforces a per-IP request limit at the edge. This is independent of your plan’s per-account rate limit and monthly quota.
Limits are enforced per account, so creating additional API keys does not raise them. Contact sales@promptguard.co for higher limits.

Response Headers

PromptGuard adds helpful headers to every response:

Error Handling

PromptGuard uses conventional HTTP response codes:

Error Response Format

Blocked requests return 403. The optional dashboard_url links directly to the event in the dashboard for audit and debugging.

Security Policy Violations

When a request is blocked for security reasons:

SDKs & Libraries

PromptGuard works with existing OpenAI/Anthropic SDKs by simply changing the base URL:

Node.js / TypeScript

Use the official OpenAI SDK with PromptGuard

Python

Use the official OpenAI Python library

Guard API

Standalone content scanning without proxying

Auto-Instrumentation

One line secures all LLM calls

OpenAPI Specification

The complete OpenAPI specification is available for:
  • Auto-generating client libraries
  • API testing and validation
  • Documentation generation

Download OpenAPI Spec

Get the full OpenAPI specification for the Developer API

Next Steps

Quick Start

Get started with PromptGuard in 5 minutes

Python SDK

Make your first secure AI request

API Keys

Learn more about API key management

Security Rules

Configure protection for your use case