The proxy endpoints take and return the same bodies as the provider APIs they stand in for: OpenAI’s
/chat/completions, /responses and /models, and Anthropic’s /messages. An existing OpenAI or Anthropic integration changes its base URL and adds an X-API-Key header.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:- PromptGuard API key (in
X-API-Keyheader) - Authenticates your PromptGuard account - LLM provider key (in
Authorizationheader) - 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
/dashboard/* takes a dashboard sign-in, not an API key. These endpoints are the API the dashboard at app.promptguard.co calls. They are not part of the public API, and no API key or long-lived token works on them. Everything under /api/v1 takes your X-API-Key instead (API reference).To script one anyway, sign in with your email and password. This needs an account that has a password, and an email domain that requires SSO is refused. The access token lasts one hour.YOUR_SESSION_TOKEN or YOUR_SESSION_COOKIE, it means the access_token from step 1, sent as Authorization: Bearer <token> or as the access_token cookie. A request acts on your personal organization unless it sends X-Organization-Id.Base URLs
Staging is a separate deployment with its own database, so a key created at app.promptguard.co does not work there.
/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. It takes and returns OpenAI’s Chat Completions format:model- The model id, which also picks the provider. See Integrations for every provider and the model ids each one takesmessages- Array of message objectstemperature,max_tokens,top_p, etc.stream- Enable streaming responsesuser- 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: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:Agent Security
Validate tool calls and monitor agent sessions:Models
List OpenAI’s models, fetched with your OpenAI key: the one inAuthorization, else the OpenAI provider key stored for the project or account. With neither, the answer is a 401 missing_api_key, as on /chat/completions; an error from OpenAI comes back with OpenAI’s status (Provider errors).
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 or organizations does not raise them. The account is the organization owner’s: a teammate’s keys in your organization use your plan’s limit and share your budget. Contact sales@promptguard.co for higher limits.
Response Headers
PromptGuard adds these headers to its responses. Each row says when the header is present:
The audit log export (
GET /dashboard/audit-log/export, JSON or CSV) stops at a row cap and says so in two headers on every export:
All four verdict headers are listed in
Access-Control-Expose-Headers, so browser JavaScript on an allowed origin can read them directly — you do not need a server-side hop to see the decision. The /api/v1/chat/completions response body is never modified: the verdict travels in these headers only, so an OpenAI-compatible client parses the body exactly as it would without PromptGuard in the path.
Error Handling
PromptGuard uses conventional HTTP response codes:
Branch on
error.code, not the status: several codes share each status, and
only some are worth retrying. Every code, with its cause and what to do, is in
the error code reference,
and an error whose code is listed there carries error.doc_url, a link to its
entry.
Error Response Format
A blocked proxy request (from staging, 2026-10-31):X-PromptGuard-Decision, X-PromptGuard-Threat-Type, X-PromptGuard-Confidence, X-PromptGuard-Event-ID and X-PromptGuard-Dashboard-URL response headers do. dashboard_url links to the event in the dashboard for audit and debugging.
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
Guardrails
Configure protection for your use case